TASK: Improve ResultItemTest

Do not repeat content, use variable which is also better to read.
And do not add unnecessary, unused, variables.
This commit is contained in:
Daniel Siepmann 2018-03-06 13:04:42 +01:00
parent f0e58afe01
commit a893303939
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4

View file

@ -57,7 +57,7 @@ class ResultItemTest extends AbstractUnitTestCase
$subject = new ResultItem($originalData);
$this->assertSame(
'Some title',
$originalData['title'],
$subject['title'],
'Could not retrieve title in array notation.'
);
@ -72,7 +72,6 @@ class ResultItemTest extends AbstractUnitTestCase
'uid' => 10,
'title' => 'Some title',
];
$expectedData = $originalData;
$subject = new ResultItem($originalData);
$this->assertTrue(isset($subject['title']), 'Could not determine that title exists.');
@ -88,7 +87,6 @@ class ResultItemTest extends AbstractUnitTestCase
'uid' => 10,
'title' => 'Some title',
];
$expectedData = $originalData;
$subject = new ResultItem($originalData);
$this->expectException(\BadMethodCallException::class);
@ -104,7 +102,6 @@ class ResultItemTest extends AbstractUnitTestCase
'uid' => 10,
'title' => 'Some title',
];
$expectedData = $originalData;
$subject = new ResultItem($originalData);
$this->expectException(\BadMethodCallException::class);