Exemplo n.º 1
0
 /**
  * Test storing and checking from DatabaseInterface.
  */
 public function testStoringAndCheckingFromDatabaseInterface()
 {
     $trackingCode = $this->stub->generate();
     $this->assertTrue(is_string($trackingCode));
     $this->assertTrue(strlen($trackingCode) === 36);
     $this->assertTrue($this->stub->check($trackingCode));
 }
Exemplo n.º 2
0
 /**
  * Test given tracking code is not valid.
  *
  * @test
  */
 public function testGivenTrackingCodeIsNotValid()
 {
     $dbMock = \Mockery::mock('\\MailTracker\\DatabaseInterface');
     $dbMock->shouldReceive('find')->with('arandomtrackingcode')->once()->andReturn(false);
     $stub = new \MailTracker\Service($dbMock);
     $this->assertFalse($stub->check('arandomtrackingcode'));
 }