public function testOnPost($expected, $format) { $file = $this->prophesize('Symfony\\Component\\Finder\\SplFileInfo'); $file->getBasename('.md')->willReturn('2010-09-09-foobar-bar'); $file->__toString()->willReturn(''); $document = new Document($file->reveal(), null, Document::TYPE_POST); $event = new CarewEvent($document); $extraction = new Optimization($format); $extraction->onDocument($event); $this->assertSame($expected, $document->getPath()); }