Skip to content

Commit

Permalink
Get class name using class keyword from PHP 5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
OndraM committed May 31, 2015
1 parent 0598117 commit 7388869
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src-tests/Component/AbstractComponentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion src-tests/Component/LegacyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
4 changes: 2 additions & 2 deletions src-tests/Process/ProcessSetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions src-tests/Publisher/XmlPublisherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down Expand Up @@ -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
Expand All @@ -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']);
Expand Down Expand Up @@ -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']);
Expand Down

0 comments on commit 7388869

Please sign in to comment.