Skip to content

Commit

Permalink
fix: run phpcdf on tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SMillerDev committed Sep 21, 2024
1 parent 9ecdcbb commit a91be27
Show file tree
Hide file tree
Showing 32 changed files with 62 additions and 82 deletions.
1 change: 0 additions & 1 deletion tests/Unit/Controller/ExportControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,5 +167,4 @@ public function testGetAllArticles()
$return->render()
);
}

}
3 changes: 1 addition & 2 deletions tests/Unit/Controller/FeedApiControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ public function testRead()
{
$this->feedService->expects($this->once())
->method('read')
->with($this->userID,3,30);
->with($this->userID, 3, 30);

$this->class->read(3, 30);
}
Expand Down Expand Up @@ -413,5 +413,4 @@ public function testUpdateError()

$this->class->update($userId, $feedId);
}

}
5 changes: 2 additions & 3 deletions tests/Unit/Controller/FeedControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,8 @@ public function testCreateReturnsErrorForInvalidCreate()

$this->assertEquals($msg, $params['message']);
$this->assertEquals(
$response->getStatus(), Http::STATUS_UNPROCESSABLE_ENTITY
$response->getStatus(),
Http::STATUS_UNPROCESSABLE_ENTITY
);
}

Expand Down Expand Up @@ -782,6 +783,4 @@ public function testPatchDoesNotExistOnUpdate()
$this->assertEquals('test', $params['message']);
$this->assertEquals($response->getStatus(), Http::STATUS_NOT_FOUND);
}


}
17 changes: 8 additions & 9 deletions tests/Unit/Controller/FolderApiControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

use PHPUnit\Framework\TestCase;


class FolderApiControllerTest extends TestCase
{

Expand Down Expand Up @@ -89,7 +88,8 @@ public function testIndex()
$this->assertEquals(
[
'folders' => [$folders[0]->toAPI()]
], $response
],
$response
);
}

Expand All @@ -113,7 +113,8 @@ public function testCreate()
$this->assertEquals(
[
'folders' => [$folder->toAPI()]
], $response
],
$response
);
}

Expand Down Expand Up @@ -153,7 +154,8 @@ public function testCreateInvalidFolderName()
$data = $response->getData();
$this->assertEquals($msg, $data['message']);
$this->assertEquals(
Http::STATUS_UNPROCESSABLE_ENTITY, $response->getStatus()
Http::STATUS_UNPROCESSABLE_ENTITY,
$response->getStatus()
);
}

Expand Down Expand Up @@ -260,7 +262,8 @@ public function testUpdateInvalidFolderName()
$data = $response->getData();
$this->assertEquals($this->msg, $data['message']);
$this->assertEquals(
Http::STATUS_UNPROCESSABLE_ENTITY, $response->getStatus()
Http::STATUS_UNPROCESSABLE_ENTITY,
$response->getStatus()
);
}

Expand All @@ -278,15 +281,11 @@ public function testUpdateRoot()
{
$response = $this->class->update(null, '');
$this->assertSame(400, $response->getStatus());

}

public function testDeleteRoot()
{
$response = $this->class->delete(null);
$this->assertSame(400, $response->getStatus());

}


}
3 changes: 1 addition & 2 deletions tests/Unit/Controller/FolderControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,5 +306,4 @@ public function testRestoreConflict()
$this->assertEquals(Http::STATUS_CONFLICT, $response->getStatus());
$this->assertEquals($this->msg, $params['message']);
}

}
}
1 change: 0 additions & 1 deletion tests/Unit/Controller/ItemApiControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

use PHPUnit\Framework\TestCase;


class ItemApiControllerTest extends TestCase
{
/**
Expand Down
3 changes: 0 additions & 3 deletions tests/Unit/Controller/ItemControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
use OCP\IUserSession;
use PHPUnit\Framework\TestCase;


class ItemControllerTest extends TestCase
{

Expand Down Expand Up @@ -624,6 +623,4 @@ public function testGetNewItemsNoNewestItemsId()
$response = $this->controller->newItems(ListType::FEED, 2, 3);
$this->assertEquals([], $response);
}


}
4 changes: 1 addition & 3 deletions tests/Unit/Controller/JSONHttpErrorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,10 @@ public function testError()
$this->assertEquals(['message' => 'hi'], $result->getData());
$this->assertEquals(3, $result->getStatus());
}


}


class DummyTraitingClass
{
use JSONHttpErrorTrait;
}
}
3 changes: 0 additions & 3 deletions tests/Unit/Controller/PageControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ public function testExplore()
$out = $this->controller->explore('en');

$this->assertEquals($in, $out);

}

public function testExploreError()
Expand All @@ -295,7 +294,5 @@ public function testExploreError()
$out = $this->controller->explore('nl');

$this->assertEquals(404, $out->getStatus());

}

}
2 changes: 0 additions & 2 deletions tests/Unit/Controller/UtilityApiControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,4 @@ public function testStatus()

$this->assertEquals($in, $result);
}


}
1 change: 0 additions & 1 deletion tests/Unit/Db/FeedMapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ protected function setUp(): void
$feed2->resetUpdatedFields();

$this->feeds = [$feed1, $feed2];

}

/**
Expand Down
8 changes: 4 additions & 4 deletions tests/Unit/Db/FeedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ public function testToAPI()
'updateErrorCount' => 2,
'lastUpdateError' => 'hi',
'items' => [],
], $feed->toAPI()
],
$feed->toAPI()
);
}

Expand Down Expand Up @@ -121,7 +122,8 @@ public function testSerialize()
'lastUpdateError' => 'hi',
'basicAuthUser' => 'user',
'basicAuthPassword' => 'password'
], $feed->jsonSerialize()
],
$feed->jsonSerialize()
);
}

Expand Down Expand Up @@ -200,6 +202,4 @@ public function testSetPinned()
$feed->setPinned(true);
$this->assertEquals(true, $feed->getPinned());
}


}
6 changes: 4 additions & 2 deletions tests/Unit/Db/FolderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public function testToAPI()
'name' => 'name',
'opened' => false,
'feeds' => [],
], $folder->toAPI()
],
$folder->toAPI()
);
}

Expand Down Expand Up @@ -75,7 +76,8 @@ public function testSerialize()
'userId' => 'abc',
'opened' => true,
'deletedAt' => 9,
], $folder->jsonSerialize()
],
$folder->jsonSerialize()
);
}
public function testSetDeletedAt()
Expand Down
1 change: 0 additions & 1 deletion tests/Unit/Db/ItemMapperAfterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -585,5 +585,4 @@ public function testFindAllAfterInvalid()
$result = $this->class->findAllAfter('jack', 232, 1610903351);
$this->assertEquals([Item::fromRow(['id' => 4])], $result);
}

}
1 change: 0 additions & 1 deletion tests/Unit/Db/ItemMapperPaginatedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1276,5 +1276,4 @@ public function testFindAllFolderSearchId()
$result = $this->class->findAllFolder('jack', 2, 10, 10, false, false, ['key', 'word']);
$this->assertEquals([Item::fromRow(['id' => 4])], $result);
}

}
1 change: 0 additions & 1 deletion tests/Unit/Db/ItemMapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1113,5 +1113,4 @@ public function testDeleteOverThresholdSuccessUnreadSkipsIfUnderThreshold()
$res = $this->class->deleteOverThreshold(3, false);
$this->assertSame(10, $res);
}

}
6 changes: 4 additions & 2 deletions tests/Unit/Db/ItemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ public function testJSONSerialize()
'categories' => ['food'],
'sharedBy' => 'jack',
'sharedByDisplayName' => 'Jack'
], $item->jsonSerialize()
],
$item->jsonSerialize()
);
}

Expand Down Expand Up @@ -274,7 +275,8 @@ public function testToExport()
'starred' => true,
'feedLink' => 'http://test',
'rtl' => true
], $item->toExport($feeds)
],
$item->toExport($feeds)
);
}

Expand Down
5 changes: 3 additions & 2 deletions tests/Unit/Db/NewsMapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
*
* @package OCA\News\Tests\Unit\Db
*/
abstract class TmpNewsMapper extends NewsMapperV2 {
abstract class TmpNewsMapper extends NewsMapperV2
{
const TABLE_NAME = 'NAME';
}

Expand Down Expand Up @@ -272,4 +273,4 @@ public function testPurgeBoth()

$result = $this->class->purgeDeleted('jack', 1);
}
}
}
3 changes: 1 addition & 2 deletions tests/Unit/Fetcher/FeedIoClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

namespace OCA\News\Tests\Unit\Fetcher;


use DateTime;
use FeedIo\Adapter\Guzzle\Response;
use FeedIo\Adapter\NotFoundException;
Expand Down Expand Up @@ -89,4 +88,4 @@ public function testGetResponseThrows(): void

$this->class->getResponse('url', new DateTime('@0'));
}
}
}
3 changes: 0 additions & 3 deletions tests/Unit/Fetcher/FetcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

namespace OCA\News\Tests\Unit\Fetcher;


use OCA\News\Fetcher\Fetcher;
use OCA\News\Fetcher\IFeedFetcher;
use PHPUnit\Framework\TestCase;
Expand Down Expand Up @@ -142,6 +141,4 @@ public function testMultipleFetchersOnlyOneShouldHandle()

$this->assertEquals($return, $result);
}


}
3 changes: 2 additions & 1 deletion tests/Unit/Search/ItemSearchProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ public function testSearch()
10,
0,
false,
['some text'])
['some text']
)
->willReturn($items);


Expand Down
Loading

0 comments on commit a91be27

Please sign in to comment.