. */ use Sikofitt\Retrorsum\Finder; /** * Class FinderTest. */ class FinderTest extends PHPUnit_Framework_TestCase { private $finder; public function setUp() { $this->finder = new Finder('aldkflsaf.log'); } /** * @coversDefaultClass \Sikofitt\Retrorsum\Finder * @covers \Sikofitt\Retrorsum\Finder::__toString() * @covers \Finder::getPath() */ public function testToRoot() { $this->assertEmpty((string) $this->finder); $this->assertEmpty($this->finder->getPath()); $this->assertFalse($this->finder->isFound()); } /** * @covers \Sikofitt\Retrorsum\Finder::setFile() */ public function testFind() { $this->finder->setFile('composer.json'); $this->assertSame(realpath(dirname(__DIR__)), (string) $this->finder); $this->assertTrue($this->finder->isFound()); } public function testInitiateToString() { $finder = (string) (new Finder('composer.json')); $this->assertSame(realpath(dirname(__DIR__)), $finder); } }