/** * Constructs a test case with the given filename. * * @param string $filename * @throws \PHPUnit_Framework_Exception */ public function __construct($filename, $silent) { if (!is_string($filename)) { throw \PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string'); } if (!is_file($filename)) { throw new \PHPUnit_Framework_Exception(sprintf('File "%s" does not exist.', $filename)); } $this->filename = $filename; $this->silent = $silent; $this->codeRunner = CodeRunnerFactory::getInstance(); $this->zeptHydrator = ZeptHydratorFactory::getInstance(); }
/** * Factory. * * @return \ZephirTestCase\ZeptHydrator */ public static function getInstance() { return new ZeptHydrator(CodeRunnerFactory::getInstance(), new FileWorker()); }