Skip to content

Commit dbd94a2

Browse files
committed
Fix new usages after rebase
1 parent e43f288 commit dbd94a2

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/Symfony/Bridge/PhpUnit/SymfonyTestsListener.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@
1919
use PHPUnit\Framework\TestSuite;
2020
use PHPUnit\Util\Blacklist;
2121
use PHPUnit\Util\Test as TestUtil;
22+
use PHPUnit\Framework\Warning;
2223
} else {
2324
use \PHPUnit_Framework_AssertionFailedError as AssertionFailedError;
2425
use \PHPUnit_Framework_BaseTestListener as BaseTestListener;
2526
use \PHPUnit_Framework_Test as Test;
2627
use \PHPUnit_Framework_TestCase as TestCase;
2728
use \PHPUnit_Framework_TestSuite as TestSuite;
29+
use \PHPUnit_Framework_Warning as Warning;
2830
use \PHPUnit_Runner_BaseTestRunner as BaseTestRunner;
2931
use \PHPUnit_Util_Blacklist as Blacklist;
3032
use \PHPUnit_Util_Test as TestUtil;
@@ -191,18 +193,18 @@ public function startTest(Test $test)
191193
}
192194
}
193195

194-
public function addWarning(\PHPUnit_Framework_Test $test, \PHPUnit_Framework_Warning $e, $time)
196+
public function addWarning(Test $test, Warning $e, $time)
195197
{
196-
if ($test instanceof \PHPUnit_Framework_TestCase) {
198+
if ($test instanceof TestCase) {
197199
$this->testsWithWarnings[$test->getName()] = true;
198200
}
199201
}
200202

201203
public function endTest(Test $test, $time)
202204
{
203205
$className = get_class($test);
204-
$classGroups = \PHPUnit_Util_Test::getGroups($className);
205-
$groups = \PHPUnit_Util_Test::getGroups($className, $test->getName(false));
206+
$classGroups = TestUtil::getGroups($className);
207+
$groups = TestUtil::getGroups($className, $test->getName(false));
206208

207209
if ($this->expectedDeprecations) {
208210
restore_error_handler();
@@ -228,19 +230,19 @@ public function endTest(Test $test, $time)
228230
}
229231
}
230232

231-
if ($test instanceof \PHPUnit_Framework_TestCase && 0 === strpos($test->getName(), 'testLegacy') && !isset($this->testsWithWarnings[$test->getName()]) && !in_array('legacy', $groups, true)) {
233+
if ($test instanceof TestCase && 0 === strpos($test->getName(), 'testLegacy') && !isset($this->testsWithWarnings[$test->getName()]) && !in_array('legacy', $groups, true)) {
232234
$result = $test->getTestResultObject();
233235

234236
if (method_exists($result, 'addWarning')) {
235-
$result->addWarning($test, new \PHPUnit_Framework_Warning('Using the "testLegacy" prefix to mark tests as legacy is deprecated since version 3.3 and will be removed in 4.0. Use the "@group legacy" notation instead to add the test to the legacy group.'), $time);
237+
$result->addWarning($test, new Warning('Using the "testLegacy" prefix to mark tests as legacy is deprecated since version 3.3 and will be removed in 4.0. Use the "@group legacy" notation instead to add the test to the legacy group.'), $time);
236238
}
237239
}
238240

239-
if ($test instanceof \PHPUnit_Framework_TestCase && strpos($className, '\Legacy') && !isset($this->testsWithWarnings[$test->getName()]) && !in_array('legacy', $classGroups, true)) {
241+
if ($test instanceof TestCase && strpos($className, '\Legacy') && !isset($this->testsWithWarnings[$test->getName()]) && !in_array('legacy', $classGroups, true)) {
240242
$result = $test->getTestResultObject();
241243

242244
if (method_exists($result, 'addWarning')) {
243-
$result->addWarning($test, new \PHPUnit_Framework_Warning('Using the "Legacy" prefix to mark all tests of a class as legacy is deprecated since version 3.3 and will be removed in 4.0. Use the "@group legacy" notation instead to add the test to the legacy group.'), $time);
245+
$result->addWarning($test, new Warning('Using the "Legacy" prefix to mark all tests of a class as legacy is deprecated since version 3.3 and will be removed in 4.0. Use the "@group legacy" notation instead to add the test to the legacy group.'), $time);
244246
}
245247
}
246248
}

0 commit comments

Comments
 (0)