Пример #1
0
 public function testGetReturnsBlockOnExistingFile()
 {
     $identifier = new Identifier('test', 'isblocked');
     $block = new Block($identifier, $this->ownerMock->reveal(), new \DateTime());
     $this->adapter->write($block);
     $result = $this->adapter->get($identifier);
     $this->assertNotNull($result);
     $this->assertInstanceOf('Brainbits\\Blocking\\Block', $result);
 }
Пример #2
0
 public function testGetBlockReturnsBlockOnExistingBlock()
 {
     $blocker = new Blocker($this->getExistingAdapterMock()->reveal(), $this->ownerMock->reveal(), $this->getValidValidatorMock()->reveal());
     $result = $blocker->getBlock($this->identifierMock->reveal());
     $this->assertInstanceOf(BlockInterface::class, $result);
 }