Пример #1
0
 /**
  * @test
  */
 public function tombstone_sourceDirNotMatchedFilePath_logAbsolutePath()
 {
     $this->handler->expects($this->once())->method('log')->with($this->callback(function ($vampire) {
         return $vampire instanceof Vampire && $vampire->getFile() === '/path/to/file1.php';
     }));
     $trace = TraceFixture::getTraceFixture();
     $this->graveyard->setSourceDir('/other/path');
     $this->graveyard->tombstone('date', 'author', 'label', $trace);
 }
Пример #2
0
 /**
  * @test
  */
 public function createFromCall_dataGiven_returnCorrectlyConstructedVampire()
 {
     $stackTrace = TraceFixture::getTraceFixture();
     $vampire = Vampire::createFromCall('2015-08-19', 'author', 'label', $stackTrace);
     $this->assertInstanceOf('Scheb\\Tombstone\\Vampire', $vampire);
     $this->assertInstanceOf('Scheb\\Tombstone\\Tombstone', $vampire->getTombstone());
     $this->assertEquals('2015-08-19', $vampire->getTombstoneDate());
     $this->assertEquals('author', $vampire->getAuthor());
     $this->assertEquals('label', $vampire->getLabel());
     $this->assertEquals('/path/to/file1.php', $vampire->getFile());
     $this->assertEquals(11, $vampire->getLine());
     $this->assertEquals('containingMethodName', $vampire->getMethod());
     $this->assertEquals('invokerMethodName', $vampire->getInvoker());
     $invocationDate = strtotime($vampire->getInvocationDate());
     $this->assertEquals(time(), $invocationDate, null, 5);
 }