mirror of
https://github.com/Codappix/search_core.git
synced 2024-11-25 03:16:11 +01:00
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:
parent
f0e58afe01
commit
a893303939
1 changed files with 1 additions and 4 deletions
|
@ -57,7 +57,7 @@ class ResultItemTest extends AbstractUnitTestCase
|
||||||
|
|
||||||
$subject = new ResultItem($originalData);
|
$subject = new ResultItem($originalData);
|
||||||
$this->assertSame(
|
$this->assertSame(
|
||||||
'Some title',
|
$originalData['title'],
|
||||||
$subject['title'],
|
$subject['title'],
|
||||||
'Could not retrieve title in array notation.'
|
'Could not retrieve title in array notation.'
|
||||||
);
|
);
|
||||||
|
@ -72,7 +72,6 @@ class ResultItemTest extends AbstractUnitTestCase
|
||||||
'uid' => 10,
|
'uid' => 10,
|
||||||
'title' => 'Some title',
|
'title' => 'Some title',
|
||||||
];
|
];
|
||||||
$expectedData = $originalData;
|
|
||||||
|
|
||||||
$subject = new ResultItem($originalData);
|
$subject = new ResultItem($originalData);
|
||||||
$this->assertTrue(isset($subject['title']), 'Could not determine that title exists.');
|
$this->assertTrue(isset($subject['title']), 'Could not determine that title exists.');
|
||||||
|
@ -88,7 +87,6 @@ class ResultItemTest extends AbstractUnitTestCase
|
||||||
'uid' => 10,
|
'uid' => 10,
|
||||||
'title' => 'Some title',
|
'title' => 'Some title',
|
||||||
];
|
];
|
||||||
$expectedData = $originalData;
|
|
||||||
|
|
||||||
$subject = new ResultItem($originalData);
|
$subject = new ResultItem($originalData);
|
||||||
$this->expectException(\BadMethodCallException::class);
|
$this->expectException(\BadMethodCallException::class);
|
||||||
|
@ -104,7 +102,6 @@ class ResultItemTest extends AbstractUnitTestCase
|
||||||
'uid' => 10,
|
'uid' => 10,
|
||||||
'title' => 'Some title',
|
'title' => 'Some title',
|
||||||
];
|
];
|
||||||
$expectedData = $originalData;
|
|
||||||
|
|
||||||
$subject = new ResultItem($originalData);
|
$subject = new ResultItem($originalData);
|
||||||
$this->expectException(\BadMethodCallException::class);
|
$this->expectException(\BadMethodCallException::class);
|
||||||
|
|
Loading…
Reference in a new issue