/** * Launch the Import command with the reader indicated * * @param string $provider * * @throws \Exception * * @return bool */ public function execute($provider) { $readerEngine = ReaderFactory::buildReaderEngine($provider); /** * @todo Improve this creating a custom Exception */ if (is_null($readerEngine)) { throw new \Exception('Impossible build the reader engine'); } return $this->executeWithProvider($readerEngine); }
/** * @test * @dataProvider providerReaderEngine */ public function testBuildReaderEngineFlubReader($nameReader, $nameSpaceReader) { $reader = ReaderFactory::buildReaderEngine($nameReader); $this->assertEquals($nameSpaceReader, get_class($reader), "The ReaderFactory not return an instance of {$nameSpaceReader}"); }