Skip to content

Commit 2f2e126

Browse files
committed
fix(ZMSKVR-1378): assert slotscope subject list by scope id not row order
QUERY_SUBJECTS orders by description; assert scope 141 date bounds instead of assuming a fixed first row.
1 parent e54f972 commit 2f2e126

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

zmsdb/tests/Zmsdb/ExchangeSlotscopeTest.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
namespace BO\Zmsdb\Tests;
44

55
use \BO\Zmsdb\ExchangeSlotscope as Query;
6-
use \BO\Zmsentities\Exchange;
7-
use \DateTimeImmutable as DateTime;
86

97
class ExchangeSlotscopeTest extends Base
108
{
@@ -26,10 +24,15 @@ public function testSubject()
2624
$entity = $query->readSubjectList();
2725
$this->assertEntity("\\BO\\Zmsentities\\Exchange", $entity);
2826
$this->assertGreaterThanOrEqual(44, count($entity->data));
29-
$this->assertEquals(106, $entity->data[0][0]); // scope id
30-
$this->assertEquals('2016-04-01', $entity->data[0][1]); // period start
31-
$this->assertEquals('2016-05-26', $entity->data[0][2]); // period end
3227

28+
$byScope = [];
29+
foreach ($entity->data as $row) {
30+
$byScope[(int) $row[0]] = $row;
31+
}
32+
33+
$this->assertArrayHasKey(141, $byScope);
34+
$this->assertEquals('2016-03-15', $byScope[141][1]);
35+
$this->assertEquals('2016-04-02', $byScope[141][2]);
3336
}
3437

3538
public function testPeriod()

0 commit comments

Comments
 (0)