protected function fileExists() { if (file_exists($this->getFileName())) { return; } throw ExceptionFactory::createFileDoesNotExist(__FILE__, __LINE__, $this->name); }
public function testCreateFileDoesNotExistException() { $ioException = new IOException('source.php', 8, 'File: source.phpml doesn\'t exist'); $exception = ExceptionFactory::createFileDoesNotExist('source.php', 8, 'source.phpml'); $this->assertSame($ioException->getFile(), $exception->getFile()); $this->assertSame($ioException->getLine(), $exception->getLine()); $this->assertSame($ioException->getMessage(), $exception->getMessage()); $this->assertInstanceOf('PHPML\\Exception\\IOException', $exception); }