Skip to content

Commit

Permalink
CachePlatform: fixed & enhanced tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hrach committed Feb 2, 2019
1 parent 3021776 commit b404bf1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/cases/unit/CachedPlatformTest.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,21 @@ class CachedPlatformTest extends TestCase
$expectedPs = 'ps_name';
$this->storageMock->shouldReceive('read')->with("\x007d7dae355d8345dd9301de988fd0eff7")->once()->andReturnNull();
$this->storageMock->shouldReceive('lock')->with("\x007d7dae355d8345dd9301de988fd0eff7")->once();
$this->storageMock->shouldReceive('write')->with("\x007d7dae355d8345dd9301de988fd0eff7", $expectedPs, [])->once();
$this->storageMock->shouldReceive('write')->with("\x007d7dae355d8345dd9301de988fd0eff7", [$expectedPs], [])->once();
$this->platformMock->shouldReceive('getPrimarySequenceName')->with('foo')->once()->andReturn($expectedPs);

$cols = $this->platform->getPrimarySequenceName('foo');
Assert::same($expectedPs, $cols);


$expectedPs = null;
$this->storageMock->shouldReceive('read')->with("\x007d7dae355d8345dd9301de988fd0eff7")->once()->andReturnNull();
$this->storageMock->shouldReceive('lock')->with("\x007d7dae355d8345dd9301de988fd0eff7")->once();
$this->storageMock->shouldReceive('write')->with("\x007d7dae355d8345dd9301de988fd0eff7", [null], [])->once();
$this->platformMock->shouldReceive('getPrimarySequenceName')->with('foo')->once()->andReturn(null);

$cols = $this->platform->getPrimarySequenceName('foo');
Assert::same(null, $cols);
}


Expand Down

0 comments on commit b404bf1

Please sign in to comment.