From 73888698fdac77c76811f7e98e460381cefdc355 Mon Sep 17 00:00:00 2001 From: Ondrej Machulda Date: Mon, 1 Jun 2015 00:54:45 +0200 Subject: [PATCH] Get class name using class keyword from PHP 5.5 --- src-tests/Component/AbstractComponentTest.php | 2 +- src-tests/Component/LegacyTest.php | 2 +- src-tests/Process/ProcessSetTest.php | 4 ++-- src-tests/Publisher/XmlPublisherTest.php | 10 +++++----- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src-tests/Component/AbstractComponentTest.php b/src-tests/Component/AbstractComponentTest.php index 58a4bca4..559fe91e 100644 --- a/src-tests/Component/AbstractComponentTest.php +++ b/src-tests/Component/AbstractComponentTest.php @@ -16,7 +16,7 @@ class AbstractComponentTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->testCase = $this->getMockBuilder('Lmc\Steward\Test\AbstractTestCase') + $this->testCase = $this->getMockBuilder(AbstractTestCase::class) ->setMethods(null) ->getMock(); diff --git a/src-tests/Component/LegacyTest.php b/src-tests/Component/LegacyTest.php index 67c0cc8d..ba5ae48e 100644 --- a/src-tests/Component/LegacyTest.php +++ b/src-tests/Component/LegacyTest.php @@ -17,7 +17,7 @@ class LegacyTest extends \PHPUnit_Framework_TestCase public function setUp() { - $this->testCase = $this->getMockBuilder('Lmc\Steward\Test\AbstractTestCase') + $this->testCase = $this->getMockBuilder(AbstractTestCase::class) ->setMethods(['getName']) ->getMock(); diff --git a/src-tests/Process/ProcessSetTest.php b/src-tests/Process/ProcessSetTest.php index ae65781b..06c1c08f 100644 --- a/src-tests/Process/ProcessSetTest.php +++ b/src-tests/Process/ProcessSetTest.php @@ -152,9 +152,9 @@ public function testShouldAddAndGetProcess() $this->assertArrayHasKey('Baz', $processes); $process = $processes['Baz']; - $this->assertInstanceOf('stdClass', $process); + $this->assertInstanceOf(\stdClass::class, $process); $this->assertEquals(ProcessSet::PROCESS_STATUS_QUEUED, $process->status); - $this->assertInstanceOf('Symfony\Component\Process\Process', $process->process); + $this->assertInstanceOf(Process::class, $process->process); $this->assertEquals('Foo', $process->delayAfter); $this->assertEquals(5, $process->delayMinutes); $this->assertNull($process->finishedTime); diff --git a/src-tests/Publisher/XmlPublisherTest.php b/src-tests/Publisher/XmlPublisherTest.php index df33d5d1..87eb7006 100644 --- a/src-tests/Publisher/XmlPublisherTest.php +++ b/src-tests/Publisher/XmlPublisherTest.php @@ -98,10 +98,10 @@ public function testShouldAddTestResultToEmptyFile() $fullXml = simplexml_load_file($fileName); $xml = $fullXml[0]; - $this->assertInstanceOf('\SimpleXMLElement', $xml->testcase); + $this->assertInstanceOf(\SimpleXMLElement::class, $xml->testcase); $this->assertEquals('testCaseNameFoo', $xml->testcase['name']); - $this->assertInstanceOf('\SimpleXMLElement', $xml->testcase->test); + $this->assertInstanceOf(\SimpleXMLElement::class, $xml->testcase->test); $this->assertEquals(1, count($xml->testcase->test)); $this->assertEquals('testNameBar', $xml->testcase->test['name']); @@ -135,7 +135,7 @@ public function testShouldUpdateTestStatusWhenTestIsDone($params) $xml = simplexml_load_file($fileName)[0]; // still only one test result is present - $this->assertInstanceOf('\SimpleXMLElement', $xml->testcase->test); + $this->assertInstanceOf(\SimpleXMLElement::class, $xml->testcase->test); $this->assertEquals(1, count($xml->testcase->test)); // the status is now updated and result is set @@ -159,7 +159,7 @@ public function testShouldAddTestcaseResultToEmptyFile() /** @var \SimpleXMLElement $xml */ $xml = simplexml_load_file($fileName)[0]; - $this->assertInstanceOf('\SimpleXMLElement', $xml->testcase); + $this->assertInstanceOf(\SimpleXMLElement::class, $xml->testcase); $this->assertEquals('testCaseNameFoo', $xml->testcase['name']); $this->assertEquals('queued', $xml->testcase['status']); $this->assertEmpty($xml->testcase->test['result']); @@ -189,7 +189,7 @@ public function testShouldUpdateTestcaseStatusWhenDone($params) /** @var \SimpleXMLElement $xml */ $xml = simplexml_load_file($fileName)[0]; - $this->assertInstanceOf('\SimpleXMLElement', $xml->testcase); + $this->assertInstanceOf(\SimpleXMLElement::class, $xml->testcase); $this->assertEquals('testCaseNameFoo', $xml->testcase['name']); $this->assertEquals('done', $xml->testcase['status']); $this->assertEquals('passed', $xml->testcase['result']);