diff --git a/tests/Functional/Command/ProxySyncReleasesCommandTest.php b/tests/Functional/Command/ProxySyncReleasesCommandTest.php index e7c277c1..3c23cae7 100644 --- a/tests/Functional/Command/ProxySyncReleasesCommandTest.php +++ b/tests/Functional/Command/ProxySyncReleasesCommandTest.php @@ -35,7 +35,7 @@ public function testSyncReleases(): void $commandTester = new CommandTester($command); $result = $commandTester->execute([]); - self::assertTrue(file_exists($newDist)); + self::assertFileExists($newDist); self::assertEquals($result, 0); @unlink($newDist); @@ -44,7 +44,7 @@ public function testSyncReleases(): void $commandTester = new CommandTester($command); $result = $commandTester->execute([]); - self::assertFalse(file_exists($newDist)); + self::assertFileDoesNotExist($newDist); self::assertEquals($result, 0); } @@ -68,7 +68,7 @@ public function testJobLocking(): void $commandTester = new CommandTester($command); $result = $commandTester->execute([]); - self::assertFalse(file_exists($newDist)); + self::assertFileDoesNotExist($newDist); self::assertEquals($result, 0); } diff --git a/tests/Functional/Controller/Api/OrganizationControllerTest.php b/tests/Functional/Controller/Api/OrganizationControllerTest.php index 64b868f1..0abdf5ac 100644 --- a/tests/Functional/Controller/Api/OrganizationControllerTest.php +++ b/tests/Functional/Controller/Api/OrganizationControllerTest.php @@ -35,7 +35,7 @@ public function testOrganizationsList(): void self::assertEquals(Response::HTTP_OK, $this->client->getResponse()->getStatusCode()); $json = $this->jsonResponse(); - self::assertEquals(count($json['data']), 1); + self::assertCount(1, $json['data']); self::assertEquals($json['data'][0]['name'], 'Buddy works'); self::assertEquals($json['data'][0]['alias'], 'buddy-works'); self::assertEquals($json['data'][0]['hasAnonymousAccess'], false); @@ -56,7 +56,7 @@ public function testOrganizationsListPagination(): void $json = $this->jsonResponse(); - self::assertEquals(count($json['data']), 20); + self::assertCount(20, $json['data']); self::assertEquals($json['data'][0]['name'], 'test-list-name#27'); self::assertEquals($json['data'][19]['name'], 'test-list-name#7'); diff --git a/tests/Functional/Controller/Api/PackageControllerTest.php b/tests/Functional/Controller/Api/PackageControllerTest.php index f5bd7ad8..6811387b 100644 --- a/tests/Functional/Controller/Api/PackageControllerTest.php +++ b/tests/Functional/Controller/Api/PackageControllerTest.php @@ -146,7 +146,7 @@ public function testPackagesListPagination(): void $json = $this->jsonResponse(); - self::assertEquals(count($json['data']), 20); + self::assertCount(20, $json['data']); self::assertEquals($json['total'], 41); $baseUrl = $this->urlTo('api_packages', ['organization' => self::$organization], UrlGeneratorInterface::ABSOLUTE_URL); diff --git a/tests/Functional/Controller/Api/TokenControllerTest.php b/tests/Functional/Controller/Api/TokenControllerTest.php index 40ba5b85..d11571a4 100644 --- a/tests/Functional/Controller/Api/TokenControllerTest.php +++ b/tests/Functional/Controller/Api/TokenControllerTest.php @@ -37,7 +37,7 @@ public function testTokensList(): void self::assertEquals(Response::HTTP_OK, $this->client->getResponse()->getStatusCode()); $json = $this->jsonResponse(); - self::assertEquals(count($json['data']), 1); + self::assertCount(1, $json['data']); self::assertEquals($json['data'][0]['name'], 'test-list-name'); self::assertEquals($json['data'][0]['value'], 'test-list-value'); self::assertNotEmpty($json['data'][0]['createdAt']); @@ -62,7 +62,7 @@ public function testTokensListPagination(): void $json = $this->jsonResponse(); - self::assertEquals(count($json['data']), 20); + self::assertCount(20, $json['data']); self::assertEquals($json['data'][0]['name'], 'test-list-name#28'); self::assertEquals($json['data'][19]['name'], 'test-list-name#8'); diff --git a/tests/Unit/Service/Downloader/ReactDownloaderTest.php b/tests/Unit/Service/Downloader/ReactDownloaderTest.php index 07e6cc0a..f6d8b2a1 100644 --- a/tests/Unit/Service/Downloader/ReactDownloaderTest.php +++ b/tests/Unit/Service/Downloader/ReactDownloaderTest.php @@ -14,7 +14,7 @@ public function testSuccessDownload(): void { $packages = __DIR__.'/../../../Resources/packages.json'; - self::assertTrue(is_resource((new ReactDownloader())->getContents($packages)->getOrNull())); + self::assertIsResource((new ReactDownloader())->getContents($packages)->getOrNull()); } public function testFailedDownload(): void