From 85f4a6a6918b4a95c9e4d1641eebad3b1b0cfb68 Mon Sep 17 00:00:00 2001 From: George Bateman Date: Fri, 12 Jul 2019 09:47:59 +0100 Subject: [PATCH] =?UTF-8?q?doctrine-test-bundle=205.0.3=E2=86=926.0.0,=20P?= =?UTF-8?q?HPUnit=206.5=E2=86=928.2.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [dama/doctrine-test-bundle](https://github.com/dmaicher/doctrine-test-bundle) from 5.0.3 to 6.0.0. - [Release notes](https://github.com/dmaicher/doctrine-test-bundle/releases) - [Changelog](https://github.com/dmaicher/doctrine-test-bundle/blob/master/CHANGELOG.md) - [Commits](https://github.com/dmaicher/doctrine-test-bundle/compare/v5.0.3...v6.0.0) composer.json now says it provides phpunit to avoid it being installed as a requirement of dms/phpunit-arraysubset-asserts, which is a replacement for an assert which was removed from PHPUnit. --- .gitignore | 1 + composer.json | 4 +- composer.lock | 69 +++++++++++++++---- runtests | 2 +- .../Service/UserMergerTest.php | 2 +- .../Controller/ContactUsControllerTest.php | 6 +- .../Controller/DiaryControllerTest.php | 2 +- .../Controller/SearchControllerTest.php | 4 +- .../Controller/ShowControllerTest.php | 2 +- .../Controller/SigninsheetControllerTest.php | 4 +- .../Entity/ApplicationRepositoryTest.php | 2 +- .../Entity/AuditionRepositoryTest.php | 2 +- .../Entity/TechieAdvertRepositoryTest.php | 2 +- .../Form/Type/EntitySearchTypeTest.php | 2 +- .../Service/ContactEntityServiceTest.php | 2 +- .../Service/EmailDispatcherTest.php | 2 +- .../Service/ModerationManagerTest.php | 2 +- .../CamdramBundle/Service/TextServiceTest.php | 2 +- .../Constraints/MapDistanceValidatorTest.php | 2 +- .../Controller/DefaultControllerTest.php | 2 +- .../Security/Acl/AclProviderTest.php | 12 ++-- .../Security/Acl/Voter/AdminVoterTest.php | 2 +- .../Security/Acl/Voter/CreateVoterTest.php | 2 +- .../Security/Acl/Voter/EditorVoterTest.php | 2 +- .../Security/Acl/Voter/OwnerVoterTest.php | 2 +- .../Security/Acl/Voter/ProfileVoterTest.php | 2 +- .../Security/Acl/Voter/ShowVoterTest.php | 2 +- .../Security/Acl/Voter/ViewVoterTest.php | 2 +- tests/DiaryBundle/Diary/DiaryRowTest.php | 2 +- tests/DiaryBundle/Diary/DiaryWeekTest.php | 2 +- tests/Functional/OAuthTest.php | 2 +- tests/Functional/SmokeTest.php | 8 +-- tests/Functional/VacanciesTest.php | 34 ++++----- tests/RepositoryTestCase.php | 4 +- tests/RestTestCase.php | 10 +-- 35 files changed, 124 insertions(+), 80 deletions(-) diff --git a/.gitignore b/.gitignore index 75eafd68e..05382fe61 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ composer.phar .*.swp bin .web-server-pid +.phpunit.result.cache node_modules assets/js/fos_js_routes.json coverage.xml diff --git a/composer.json b/composer.json index 483cd0953..0a9f87b1b 100644 --- a/composer.json +++ b/composer.json @@ -33,6 +33,7 @@ "minimum-stability": "stable", "name": "camdram/camdram", "replace": { + "phpunit/phpunit": "8.2.4", "symfony/polyfill-php56": "1.99", "symfony/polyfill-php70": "1.99", "symfony/polyfill-php71": "1.99", @@ -75,7 +76,8 @@ "zendframework/zend-feed": "2.12.*" }, "require-dev": { - "dama/doctrine-test-bundle": "^5.0", + "dama/doctrine-test-bundle": "^6.0", + "dms/phpunit-arraysubset-asserts": "^0.1.0", "sensio/generator-bundle": "^3.1", "symfony/phpunit-bridge": "^4.1", "symfony/web-server-bundle": "^3.4" diff --git a/composer.lock b/composer.lock index 521fa846d..22fd2b350 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "fa14639e7f654388d97e4af1064b0fa6", + "content-hash": "ee7613a2291c3d4d5d8c4f97be44635d", "packages": [ { "name": "abraham/twitteroauth", @@ -7707,33 +7707,33 @@ "packages-dev": [ { "name": "dama/doctrine-test-bundle", - "version": "v5.0.3", + "version": "v6.0.0", "source": { "type": "git", "url": "https://github.com/dmaicher/doctrine-test-bundle.git", - "reference": "29882b0d1a815f4819126ef714931bb24a31cbaa" + "reference": "2b7028e3748224921b42d23225bbb9016c8a303d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dmaicher/doctrine-test-bundle/zipball/29882b0d1a815f4819126ef714931bb24a31cbaa", - "reference": "29882b0d1a815f4819126ef714931bb24a31cbaa", + "url": "https://api.github.com/repos/dmaicher/doctrine-test-bundle/zipball/2b7028e3748224921b42d23225bbb9016c8a303d", + "reference": "2b7028e3748224921b42d23225bbb9016c8a303d", "shasum": "" }, "require": { - "doctrine/dbal": "~2.5", - "doctrine/doctrine-bundle": "~1.4", - "php": "^7.1", - "symfony/framework-bundle": "~2.7|~3.0|~4.0" + "doctrine/dbal": "~2.9", + "doctrine/doctrine-bundle": "~1.11", + "php": "^7.2", + "symfony/framework-bundle": "~3.0|~4.0" }, "require-dev": { - "phpunit/phpunit": "~6.0|~7.0|~8.0", - "symfony/phpunit-bridge": "~2.8|~3.0|~4.0", - "symfony/yaml": "~2.8|~3.0|~4.0" + "phpunit/phpunit": "~7.0|~8.0", + "symfony/phpunit-bridge": "~4.3", + "symfony/yaml": "~3.0|~4.0" }, "type": "symfony-bundle", "extra": { "branch-alias": { - "dev-master": "5.1.x-dev" + "dev-master": "6.1.x-dev" } }, "autoload": { @@ -7762,7 +7762,48 @@ "symfony 2", "tests" ], - "time": "2019-03-22T10:34:17+00:00" + "time": "2019-07-10T14:13:32+00:00" + }, + { + "name": "dms/phpunit-arraysubset-asserts", + "version": "v0.1.0", + "source": { + "type": "git", + "url": "https://github.com/rdohms/phpunit-arraysubset-asserts.git", + "reference": "d618ece5d53e05be87eba835b079377eaafbd7c8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/rdohms/phpunit-arraysubset-asserts/zipball/d618ece5d53e05be87eba835b079377eaafbd7c8", + "reference": "d618ece5d53e05be87eba835b079377eaafbd7c8", + "shasum": "" + }, + "require": { + "php": "^7.2", + "phpunit/phpunit": "^8.0" + }, + "require-dev": { + "dms/coding-standard": "^1.0", + "squizlabs/php_codesniffer": "^3.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "DMS\\PHPUnitExtensions\\ArraySubset\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Rafael Dohms", + "email": "rdohms@gmail.com" + } + ], + "description": "This package provides Array Subset and related asserts once depracated in PHPunit 8", + "time": "2019-02-17T14:29:58+00:00" }, { "name": "sensio/generator-bundle", diff --git a/runtests b/runtests index a4a46b3b7..259731dd5 100755 --- a/runtests +++ b/runtests @@ -1,6 +1,6 @@ #!/bin/bash set -e -export SYMFONY_PHPUNIT_VERSION=6.5 +export SYMFONY_PHPUNIT_VERSION=8.2.4 export SYMFONY_DEPRECATIONS_HELPER="max[self]=0" export SYMFONY_ENV=test diff --git a/tests/CamdramAdminBundle/Service/UserMergerTest.php b/tests/CamdramAdminBundle/Service/UserMergerTest.php index c84a71572..afac54171 100644 --- a/tests/CamdramAdminBundle/Service/UserMergerTest.php +++ b/tests/CamdramAdminBundle/Service/UserMergerTest.php @@ -15,7 +15,7 @@ class UserMergerTest extends RepositoryTestCase private $person; private $ace; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/CamdramBundle/Controller/ContactUsControllerTest.php b/tests/CamdramBundle/Controller/ContactUsControllerTest.php index ae188ef13..8e4eb782e 100644 --- a/tests/CamdramBundle/Controller/ContactUsControllerTest.php +++ b/tests/CamdramBundle/Controller/ContactUsControllerTest.php @@ -26,12 +26,12 @@ public function testSendMessage() $this->assertSame(1, $mailCollector->getMessageCount()); $message = $mailCollector->getMessages()[0]; - $this->assertContains('Test Message', $message->getSubject()); + $this->assertStringContainsString('Test Message', $message->getSubject()); $this->assertSame('john@domain.com', key($message->getReplyTo())); $recipient = $client->getKernel()->getContainer()->getParameter('support_email_address'); $this->assertSame($recipient, key($message->getFrom())); $this->assertSame($recipient, key($message->getTo())); - $this->assertContains('Lorem ipsum', $message->getBody()); + $this->assertStringContainsString('Lorem ipsum', $message->getBody()); } -} \ No newline at end of file +} diff --git a/tests/CamdramBundle/Controller/DiaryControllerTest.php b/tests/CamdramBundle/Controller/DiaryControllerTest.php index 4e8ce5b32..58d499220 100644 --- a/tests/CamdramBundle/Controller/DiaryControllerTest.php +++ b/tests/CamdramBundle/Controller/DiaryControllerTest.php @@ -13,7 +13,7 @@ class DiaryControllerTest extends RestTestCase { - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/CamdramBundle/Controller/SearchControllerTest.php b/tests/CamdramBundle/Controller/SearchControllerTest.php index f19de2bfd..fb0b37c45 100644 --- a/tests/CamdramBundle/Controller/SearchControllerTest.php +++ b/tests/CamdramBundle/Controller/SearchControllerTest.php @@ -30,7 +30,7 @@ class SearchControllerTest extends WebTestCase */ private $user; - public function setUp() + public function setUp(): void { $this->client = self::createClient(array('environment' => 'test')); @@ -122,7 +122,7 @@ private function doJsonRequest($url, $params) $response = $this->client->getResponse(); $this->assertEquals(200, $response->getStatusCode()); - $this->assertContains('application/json', $response->headers->get('Content-Type')); + $this->assertStringContainsString('application/json', $response->headers->get('Content-Type')); return json_decode($response->getContent(), true); } diff --git a/tests/CamdramBundle/Controller/ShowControllerTest.php b/tests/CamdramBundle/Controller/ShowControllerTest.php index 9ba3a1981..895333533 100644 --- a/tests/CamdramBundle/Controller/ShowControllerTest.php +++ b/tests/CamdramBundle/Controller/ShowControllerTest.php @@ -15,7 +15,7 @@ class ShowControllerTest extends RestTestCase */ private $show; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/CamdramBundle/Controller/SigninsheetControllerTest.php b/tests/CamdramBundle/Controller/SigninsheetControllerTest.php index 6c22df9ed..3fd02af7b 100644 --- a/tests/CamdramBundle/Controller/SigninsheetControllerTest.php +++ b/tests/CamdramBundle/Controller/SigninsheetControllerTest.php @@ -19,14 +19,14 @@ public function testAddRemoveRole() foreach (['', '.csv'] as $format) { $crawler = $this->client->request('GET', '/shows/non-existent-test/signinsheet'.$format); $this->assertEquals(404, $this->client->getResponse()->getStatusCode()); - $this->assertContains('That show does not exist', $this->client->getResponse()->getContent()); + $this->assertStringContainsString('That show does not exist', $this->client->getResponse()->getContent()); } // Test no performances foreach (['', '.csv'] as $format) { $crawler = $this->client->request('GET', '/shows/'.$show->getSlug().'/signinsheet' . $format); $this->assertEquals(404, $this->client->getResponse()->getStatusCode()); - $this->assertContains('There are no performances associated with this show', $this->client->getResponse()->getContent()); + $this->assertStringContainsString('There are no performances associated with this show', $this->client->getResponse()->getContent()); } // Test with a performance, spanning a timezone change for the UK. diff --git a/tests/CamdramBundle/Entity/ApplicationRepositoryTest.php b/tests/CamdramBundle/Entity/ApplicationRepositoryTest.php index e9a96f15c..15c5687a9 100644 --- a/tests/CamdramBundle/Entity/ApplicationRepositoryTest.php +++ b/tests/CamdramBundle/Entity/ApplicationRepositoryTest.php @@ -12,7 +12,7 @@ class ApplicationRepositoryTest extends RepositoryTestCase private $show; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/CamdramBundle/Entity/AuditionRepositoryTest.php b/tests/CamdramBundle/Entity/AuditionRepositoryTest.php index a5bf4abfa..8919a4d28 100644 --- a/tests/CamdramBundle/Entity/AuditionRepositoryTest.php +++ b/tests/CamdramBundle/Entity/AuditionRepositoryTest.php @@ -12,7 +12,7 @@ class AuditionRepositoryTest extends RepositoryTestCase private $show; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/CamdramBundle/Entity/TechieAdvertRepositoryTest.php b/tests/CamdramBundle/Entity/TechieAdvertRepositoryTest.php index 326a02e0c..e170b58bd 100644 --- a/tests/CamdramBundle/Entity/TechieAdvertRepositoryTest.php +++ b/tests/CamdramBundle/Entity/TechieAdvertRepositoryTest.php @@ -12,7 +12,7 @@ class TechieAdvertRepositoryTest extends RepositoryTestCase private $show; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/CamdramBundle/Form/Type/EntitySearchTypeTest.php b/tests/CamdramBundle/Form/Type/EntitySearchTypeTest.php index 5e1b63b59..93c8ec9dd 100644 --- a/tests/CamdramBundle/Form/Type/EntitySearchTypeTest.php +++ b/tests/CamdramBundle/Form/Type/EntitySearchTypeTest.php @@ -20,7 +20,7 @@ class EntitySearchTypeTest extends TypeTestCase */ private $em; - public function setUp() + public function setUp(): void { $this->repo = $this->getMockBuilder('Acts\\CamdramBundle\\Entity\\SocietyRepository') ->disableOriginalConstructor() diff --git a/tests/CamdramBundle/Service/ContactEntityServiceTest.php b/tests/CamdramBundle/Service/ContactEntityServiceTest.php index 5211148b1..d76d50786 100644 --- a/tests/CamdramBundle/Service/ContactEntityServiceTest.php +++ b/tests/CamdramBundle/Service/ContactEntityServiceTest.php @@ -29,7 +29,7 @@ class ContactEntityServiceTest extends TestCase */ private $contactEntityService; - public function setUp() + public function setUp(): void { $this->mailer = $this->getMockBuilder('\Swift_Mailer') ->disableOriginalConstructor()->disableOriginalClone()->getMock(); diff --git a/tests/CamdramBundle/Service/EmailDispatcherTest.php b/tests/CamdramBundle/Service/EmailDispatcherTest.php index 863a311c6..a469d00a6 100644 --- a/tests/CamdramBundle/Service/EmailDispatcherTest.php +++ b/tests/CamdramBundle/Service/EmailDispatcherTest.php @@ -28,7 +28,7 @@ class EmailDispatcherTest extends TestCase private $from_address = 'from-address@camdram.net'; - public function setUp() + public function setUp(): void { $this->mailer = $this->getMockBuilder('\Swift_Mailer') ->disableOriginalConstructor()->disableOriginalClone()->getMock(); diff --git a/tests/CamdramBundle/Service/ModerationManagerTest.php b/tests/CamdramBundle/Service/ModerationManagerTest.php index ae3fb706b..a158480d0 100644 --- a/tests/CamdramBundle/Service/ModerationManagerTest.php +++ b/tests/CamdramBundle/Service/ModerationManagerTest.php @@ -60,7 +60,7 @@ class ModerationManagerTest extends TestCase private $venue; private $ownedShow; - public function setUp() + public function setUp(): void { $this->entityManager = $this->getMockBuilder('Doctrine\\ORM\\EntityManager') ->disableOriginalConstructor()->getMock(); diff --git a/tests/CamdramBundle/Service/TextServiceTest.php b/tests/CamdramBundle/Service/TextServiceTest.php index 3f2d63f39..d84b29030 100644 --- a/tests/CamdramBundle/Service/TextServiceTest.php +++ b/tests/CamdramBundle/Service/TextServiceTest.php @@ -12,7 +12,7 @@ class TextServiceTest extends TestCase */ private $textService; - public function setUp() + public function setUp(): void { $this->textService = new TextService(); } diff --git a/tests/CamdramBundle/Validator/Constraints/MapDistanceValidatorTest.php b/tests/CamdramBundle/Validator/Constraints/MapDistanceValidatorTest.php index 221b57823..fedef50e8 100644 --- a/tests/CamdramBundle/Validator/Constraints/MapDistanceValidatorTest.php +++ b/tests/CamdramBundle/Validator/Constraints/MapDistanceValidatorTest.php @@ -20,7 +20,7 @@ protected function createValidator() return new MapDistanceValidator(); } - public function setUp() + public function setUp(): void { $this->mapDistanceConstraint = new MapDistance(); $this->mapDistanceConstraint->nearTo = array(52.1, 0.5); diff --git a/tests/CamdramSecurityBundle/Controller/DefaultControllerTest.php b/tests/CamdramSecurityBundle/Controller/DefaultControllerTest.php index 41ae66f27..ad41e631a 100644 --- a/tests/CamdramSecurityBundle/Controller/DefaultControllerTest.php +++ b/tests/CamdramSecurityBundle/Controller/DefaultControllerTest.php @@ -23,7 +23,7 @@ class DefaultControllerTest extends WebTestCase */ private $aclProvider; - public function setUp() + public function setUp(): void { $this->client = self::createClient(['environment' => 'test']); $this->client->followRedirects(true); diff --git a/tests/CamdramSecurityBundle/Security/Acl/AclProviderTest.php b/tests/CamdramSecurityBundle/Security/Acl/AclProviderTest.php index 488294a8c..937f6367e 100644 --- a/tests/CamdramSecurityBundle/Security/Acl/AclProviderTest.php +++ b/tests/CamdramSecurityBundle/Security/Acl/AclProviderTest.php @@ -9,11 +9,13 @@ use Acts\CamdramSecurityBundle\Entity\User; use Acts\CamdramSecurityBundle\Entity\ExternalUser; use Acts\CamdramSecurityBundle\Security\Acl\AclProvider; +use DMS\PHPUnitExtensions\ArraySubset\ArraySubsetAsserts; use Symfony\Component\EventDispatcher\EventDispatcher; use Camdram\Tests\RepositoryTestCase; class AclProviderTest extends RepositoryTestCase { + use ArraySubsetAsserts; /** * @var \Acts\CamdramSecurityBundle\Security\Acl\AclProvider @@ -36,7 +38,7 @@ class AclProviderTest extends RepositoryTestCase private $user; private $user2; - public function setUp() + public function setUp(): void { parent::setUp(); $this->aclProvider = new AclProvider($this->em, new EventDispatcher()); @@ -140,19 +142,15 @@ public function testGetOrganisationIdsByUser() $this->assertSame($this->aclProvider->getOrganisationIdsByUser($this->user2), []); } - /** - * @expectedException \ReflectionException - */ public function testGetEntityIdsByUser_InvalidClass() { + $this->expectException(\ReflectionException::class); $this->aclProvider->getEntityIdsByUser($this->user, '\AnInvalidClassName'); } - /** - * @expectedException \InvalidArgumentException - */ public function testGetEntityIdsByUser_NonOwnableClass() { + $this->expectException(\InvalidArgumentException::class); $this->aclProvider->getEntityIdsByUser($this->user, '\\Acts\\CamdramBundle\\Entity\\News'); } diff --git a/tests/CamdramSecurityBundle/Security/Acl/Voter/AdminVoterTest.php b/tests/CamdramSecurityBundle/Security/Acl/Voter/AdminVoterTest.php index e452fa78b..450c6c809 100644 --- a/tests/CamdramSecurityBundle/Security/Acl/Voter/AdminVoterTest.php +++ b/tests/CamdramSecurityBundle/Security/Acl/Voter/AdminVoterTest.php @@ -17,7 +17,7 @@ class AdminVoterTest extends TestCase */ private $voter; - public function setUp() + public function setUp(): void { $this->voter = new AdminVoter(); } diff --git a/tests/CamdramSecurityBundle/Security/Acl/Voter/CreateVoterTest.php b/tests/CamdramSecurityBundle/Security/Acl/Voter/CreateVoterTest.php index f73d9ecab..e415bb25c 100644 --- a/tests/CamdramSecurityBundle/Security/Acl/Voter/CreateVoterTest.php +++ b/tests/CamdramSecurityBundle/Security/Acl/Voter/CreateVoterTest.php @@ -18,7 +18,7 @@ class CreateVoterTest extends TestCase */ private $token; - public function setUp() + public function setUp(): void { $this->voter = new CreateVoter(); $this->token = new UsernamePasswordToken('testuser', 'password', 'public'); diff --git a/tests/CamdramSecurityBundle/Security/Acl/Voter/EditorVoterTest.php b/tests/CamdramSecurityBundle/Security/Acl/Voter/EditorVoterTest.php index 6f09d1a34..53df428e6 100644 --- a/tests/CamdramSecurityBundle/Security/Acl/Voter/EditorVoterTest.php +++ b/tests/CamdramSecurityBundle/Security/Acl/Voter/EditorVoterTest.php @@ -17,7 +17,7 @@ class EditorVoterTest extends TestCase */ private $voter; - public function setUp() + public function setUp(): void { $this->voter = new EditorVoter(); } diff --git a/tests/CamdramSecurityBundle/Security/Acl/Voter/OwnerVoterTest.php b/tests/CamdramSecurityBundle/Security/Acl/Voter/OwnerVoterTest.php index 66b7da173..34f48172e 100644 --- a/tests/CamdramSecurityBundle/Security/Acl/Voter/OwnerVoterTest.php +++ b/tests/CamdramSecurityBundle/Security/Acl/Voter/OwnerVoterTest.php @@ -27,7 +27,7 @@ class OwnerVoterTest extends TestCase */ private $token; - public function setUp() + public function setUp(): void { $this->aclProvider = $this->getMockBuilder('\Acts\\CamdramSecurityBundle\\Security\\Acl\\AclProvider') ->disableOriginalConstructor()->getMock(); diff --git a/tests/CamdramSecurityBundle/Security/Acl/Voter/ProfileVoterTest.php b/tests/CamdramSecurityBundle/Security/Acl/Voter/ProfileVoterTest.php index 479305a25..3506d161a 100644 --- a/tests/CamdramSecurityBundle/Security/Acl/Voter/ProfileVoterTest.php +++ b/tests/CamdramSecurityBundle/Security/Acl/Voter/ProfileVoterTest.php @@ -25,7 +25,7 @@ class ProfileVoterTest extends TestCase */ private $user; - public function setUp() + public function setUp(): void { $this->voter = new ProfileVoter(); $this->token = new UsernamePasswordToken('testuser', 'password', 'public'); diff --git a/tests/CamdramSecurityBundle/Security/Acl/Voter/ShowVoterTest.php b/tests/CamdramSecurityBundle/Security/Acl/Voter/ShowVoterTest.php index 17c143152..8b5641f28 100644 --- a/tests/CamdramSecurityBundle/Security/Acl/Voter/ShowVoterTest.php +++ b/tests/CamdramSecurityBundle/Security/Acl/Voter/ShowVoterTest.php @@ -33,7 +33,7 @@ class ShowVoterTest extends TestCase */ private $user; - public function setUp() + public function setUp(): void { $this->aclProvider = $this->getMockBuilder('\Acts\\CamdramSecurityBundle\\Security\\Acl\\AclProvider') ->disableOriginalConstructor()->getMock(); diff --git a/tests/CamdramSecurityBundle/Security/Acl/Voter/ViewVoterTest.php b/tests/CamdramSecurityBundle/Security/Acl/Voter/ViewVoterTest.php index e19e8afb4..0f8da1101 100644 --- a/tests/CamdramSecurityBundle/Security/Acl/Voter/ViewVoterTest.php +++ b/tests/CamdramSecurityBundle/Security/Acl/Voter/ViewVoterTest.php @@ -20,7 +20,7 @@ class ViewVoterTest extends TestCase */ private $token; - public function setUp() + public function setUp(): void { $this->voter = new ViewVoter(); $this->token = new UsernamePasswordToken('testuser', 'password', 'public'); diff --git a/tests/DiaryBundle/Diary/DiaryRowTest.php b/tests/DiaryBundle/Diary/DiaryRowTest.php index a206be67e..c411c78d4 100644 --- a/tests/DiaryBundle/Diary/DiaryRowTest.php +++ b/tests/DiaryBundle/Diary/DiaryRowTest.php @@ -14,7 +14,7 @@ class DiaryRowTest extends TestCase */ private $row; - public function setUp() + public function setUp(): void { $this->row = new DiaryRow(new \DateTime('2014-02-01')); } diff --git a/tests/DiaryBundle/Diary/DiaryWeekTest.php b/tests/DiaryBundle/Diary/DiaryWeekTest.php index 387380c03..c5cc69f37 100644 --- a/tests/DiaryBundle/Diary/DiaryWeekTest.php +++ b/tests/DiaryBundle/Diary/DiaryWeekTest.php @@ -10,7 +10,7 @@ class DiaryWeekTest extends TestCase { private $week; - public function setUp() + public function setUp(): void { $this->week = new Week(new \DateTime('2014-01-26')); } diff --git a/tests/Functional/OAuthTest.php b/tests/Functional/OAuthTest.php index 7e713492c..4a381feca 100644 --- a/tests/Functional/OAuthTest.php +++ b/tests/Functional/OAuthTest.php @@ -46,7 +46,7 @@ class OAuthTest extends WebTestCase private static $db = null; - public function setUp() + public function setUp(): void { $this->userClient = static::createClient(); diff --git a/tests/Functional/SmokeTest.php b/tests/Functional/SmokeTest.php index 146102a2a..37ce30d24 100644 --- a/tests/Functional/SmokeTest.php +++ b/tests/Functional/SmokeTest.php @@ -24,7 +24,7 @@ class SmokeTest extends WebTestCase */ private $client; - public function setUp() + public function setUp(): void { $this->client = self::createClient(array('environment' => 'test')); } @@ -36,9 +36,9 @@ public function testSuccessful() $response = $this->client->getResponse(); $this->assertEquals(200, $response->getStatusCode(), "URL: $url"); - $this->assertContains('text/html', $response->headers->get('Content-Type'), "URL: $url"); - $this->assertContains('getContent(), "URL: $url"); - $this->assertContains('', $response->getContent(), "URL: $url"); + $this->assertStringContainsString('text/html', $response->headers->get('Content-Type'), "URL: $url"); + $this->assertStringContainsString('getContent(), "URL: $url"); + $this->assertStringContainsString('', $response->getContent(), "URL: $url"); } } diff --git a/tests/Functional/VacanciesTest.php b/tests/Functional/VacanciesTest.php index 58a7c6a96..6f6f6fedf 100644 --- a/tests/Functional/VacanciesTest.php +++ b/tests/Functional/VacanciesTest.php @@ -29,7 +29,7 @@ class VacanciesTest extends WebTestCase */ private $user; - public function setUp() + public function setUp(): void { $this->client = self::createClient(array('environment' => 'test')); @@ -66,9 +66,9 @@ public function fetchHtml($url) $response = $this->client->getResponse(); $this->assertEquals(200, $response->getStatusCode(), "URL: $url"); - $this->assertContains('text/html', $response->headers->get('Content-Type'), "URL: $url"); - $this->assertContains('getContent(), "URL: $url"); - $this->assertContains('', $response->getContent(), "URL: $url"); + $this->assertStringContainsString('text/html', $response->headers->get('Content-Type'), "URL: $url"); + $this->assertStringContainsString('getContent(), "URL: $url"); + $this->assertStringContainsString('', $response->getContent(), "URL: $url"); return $response; } @@ -78,8 +78,8 @@ public function fetchText($url) $response = $this->client->getResponse(); $this->assertEquals(200, $response->getStatusCode(), "URL: $url"); - $this->assertContains('text/plain', $response->headers->get('Content-Type'), "URL: $url"); - $this->assertNotContains('', $response->getContent(), "URL: $url"); + $this->assertStringContainsString('text/plain', $response->headers->get('Content-Type'), "URL: $url"); + $this->assertStringNotContainsString('', $response->getContent(), "URL: $url"); return $response; } @@ -89,8 +89,8 @@ public function fetchRss($url) $response = $this->client->getResponse(); $this->assertEquals(200, $response->getStatusCode(), "URL: $url"); - $this->assertContains('application/rss+xml', $response->headers->get('Content-Type'), "URL: $url"); - $this->assertContains('', $response->getContent(), 'URL: $url'); + $this->assertStringContainsString('application/rss+xml', $response->headers->get('Content-Type'), "URL: $url"); + $this->assertStringContainsString('', $response->getContent(), 'URL: $url'); return $response; } @@ -109,13 +109,13 @@ public function testAuditions() $this->entityManager->flush(); $response = $this->fetchText('/vacancies/auditions.txt'); - $this->assertContains('Test Show', $response->getContent()); + $this->assertStringContainsString('Test Show', $response->getContent()); $response = $this->fetchHtml('/vacancies/auditions'); - $this->assertContains('Test Show', $response->getContent()); + $this->assertStringContainsString('Test Show', $response->getContent()); $response = $this->fetchRss('/vacancies/auditions.rss'); - $this->assertContains('Test Show', $response->getContent()); + $this->assertStringContainsString('Test Show', $response->getContent()); } public function testTechieAdverts() @@ -133,13 +133,13 @@ public function testTechieAdverts() $this->entityManager->flush(); $response = $this->fetchText('/vacancies/techies.txt'); - $this->assertContains('Test Show', $response->getContent()); + $this->assertStringContainsString('Test Show', $response->getContent()); $response = $this->fetchHtml('/vacancies/techies'); - $this->assertContains('Test Show', $response->getContent()); + $this->assertStringContainsString('Test Show', $response->getContent()); $response = $this->fetchRss('/vacancies/techies.rss'); - $this->assertContains('Test Show', $response->getContent()); + $this->assertStringContainsString('Test Show', $response->getContent()); } public function testApplications() @@ -157,13 +157,13 @@ public function testApplications() $this->entityManager->flush(); $response = $this->fetchText('/vacancies/applications.txt'); - $this->assertContains('Test Show', $response->getContent()); + $this->assertStringContainsString('Test Show', $response->getContent()); $response = $this->fetchHtml('/vacancies/applications'); - $this->assertContains('Test Show', $response->getContent()); + $this->assertStringContainsString('Test Show', $response->getContent()); $response = $this->fetchRss('/vacancies/applications.rss'); - $this->assertContains('Test Show', $response->getContent()); + $this->assertStringContainsString('Test Show', $response->getContent()); } } diff --git a/tests/RepositoryTestCase.php b/tests/RepositoryTestCase.php index 561d66d4f..9e3acfdc9 100644 --- a/tests/RepositoryTestCase.php +++ b/tests/RepositoryTestCase.php @@ -16,7 +16,7 @@ abstract class RepositoryTestCase extends KernelTestCase /** * {@inheritDoc} */ - public function setUp() + public function setUp(): void { $kernel = self::bootKernel(); $this->em = $kernel->getContainer()->get('doctrine')->getManager(); @@ -25,7 +25,7 @@ public function setUp() /** * {@inheritDoc} */ - protected function tearDown() + protected function tearDown(): void { parent::tearDown(); diff --git a/tests/RestTestCase.php b/tests/RestTestCase.php index 9568ba347..e0e069944 100644 --- a/tests/RestTestCase.php +++ b/tests/RestTestCase.php @@ -1,6 +1,7 @@ client = self::createClient(array('environment' => 'test')); $this->client->followRedirects(true); @@ -76,7 +78,7 @@ protected function doJsonRequest($url, $params = []) $response = $this->client->getResponse(); $this->assertEquals(200, $response->getStatusCode()); - $this->assertContains('application/json', $response->headers->get('Content-Type')); + $this->assertStringContainsString('application/json', $response->headers->get('Content-Type')); return json_decode($response->getContent(), true); } @@ -87,7 +89,7 @@ protected function doXmlRequest($url, $params = []) $response = $this->client->getResponse(); $this->assertEquals(200, $response->getStatusCode()); - $this->assertContains('text/xml', $response->headers->get('Content-Type')); + $this->assertStringContainsString('text/xml', $response->headers->get('Content-Type')); return new \SimpleXMLElement($response->getContent()); } @@ -96,7 +98,7 @@ protected function doICalRequest($url) $this->client->request('GET', $url); $response = $this->client->getResponse(); $this->assertEquals(200, $response->getStatusCode()); - $this->assertContains('text/calendar', $response->headers->get('Content-Type')); + $this->assertStringContainsString('text/calendar', $response->headers->get('Content-Type')); $vobj = VObject\Reader::read($response->getContent()); $this->assertEquals(0, count($vobj->validate())); return $vobj;