Skip to content

Commit 4493a62

Browse files
committed
Merge remote-tracking branch 'origin/2.1'
2 parents a50228d + e946eb3 commit 4493a62

File tree

4 files changed

+40
-1
lines changed

4 files changed

+40
-1
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,17 @@ Changelog
33

44
3.0.0 (unreleased)
55
------------------
6+
67
* **2019-02-28**: [BC-BREAK] Remove `DatabaseTestListener`, use scripts in `bin/make/` to ramp up your testing environment for several test suites
78
* **2019-02-28**: [BC-BREAK] Introduce PHPUnit 6 Support, Remove PHPUnit 5.7.
89
* **2019-02-28**: Add testing scenarios for Symfony 4.2 and 4.3 (allowed to fail for now)
910

11+
2.1.12
12+
------
13+
14+
* **2019-07-26**: Work around name collision with Symfony 4.3.
15+
`BaseTestCase::getClient` is deprecated, use `BaseTestCase::getFrameworkBundleClient` instead.
16+
1017
2.1.0
1118
-----
1219

phpunit.xml.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,8 @@
1212
</testsuite>
1313
</testsuites>
1414

15+
<listeners>
16+
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
17+
</listeners>
18+
1519
</phpunit>

src/Functional/BaseTestCase.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,26 @@ protected function getKernelConfiguration()
5454
return [];
5555
}
5656

57+
public function __call($name, $arguments)
58+
{
59+
if ('getClient' === $name) {
60+
@trigger_error(sprintf(
61+
'"%s::getClient()" is deprecated in favor of getFrameworkBundleClient() since symfony-cmf/testing 2.1 and will no longer be callable in 3.0',
62+
__CLASS__
63+
), E_USER_DEPRECATED);
64+
65+
return $this->getFrameworkBundleClient();
66+
}
67+
68+
return parent::$name(...$arguments);
69+
}
70+
5771
/**
5872
* Gets the Client.
5973
*
6074
* @return Client
6175
*/
62-
public function getClient()
76+
public function getFrameworkBundleClient()
6377
{
6478
if (null === $this->client) {
6579
$this->client = $this->createClient($this->getKernelConfiguration());

tests/Functional/BaseTestCaseTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,20 @@ public function provideTestDb()
7777
];
7878
}
7979

80+
/**
81+
* @group legacy
82+
* @expectedDeprecation "Symfony\Cmf\Component\Testing\Functional\BaseTestCase::getClient()" is deprecated in favor of getFrameworkBundleClient() since symfony-cmf/testing 2.1 and will no longer be callable in 3.0
83+
*/
84+
public function testItTriggersADeprecationErrorWhenCallingGetClient()
85+
{
86+
$this->assertInstanceOf(Client::class, $this->testCase->getClient());
87+
}
88+
89+
public function testItCanProvideAFrameworkBundleClient()
90+
{
91+
$this->assertInstanceOf(Client::class, $this->testCase->getFrameworkBundleClient());
92+
}
93+
8094
/**
8195
* @dataProvider provideTestDb
8296
* @depends testGetContainer

0 commit comments

Comments
 (0)