Tests/Functional/Import/ImportCommandTest.php
/**
     * Tests import functionality from xtCommerce.
     */
Tests import functionality from xtCommerce.
Tests import functionality from xtCommerce .
public function testImport()
    {
        $kernel = self::createClient()->getKernel();
        $this->importData('Import/xtCommerce.sql');
        $manager = $this->getManager();
        $application = new Application($kernel);
        $application->add(new ImportFullCommand());
        $command = $application->find('ongr:import:full');
        $commandTester = new CommandTester($command);
        $commandTester->execute(['command' => $command->getName()]);
        $actualDocuments = [];
        foreach ($this->repositories as $key) {
            $repository = $manager->getRepository($key);
            usleep(90000);
            foreach ($repository->execute(new Search(), Repository::RESULTS_ARRAY) as $item) {
                    $actualDocuments[$key][] = $item;
            }
        }
        foreach ($this->repositories as $key) {
            sort($actualDocuments[$key]);
            sort($this->expectedDocuments[$key]);
        }
        $this->assertEquals($this->expectedDocuments, $actualDocuments);
    }
public function testImport ( ) { $ kernel = self :: createClient ( ) -> getKernel ( ) ; $ this -> importData ( 'Import/xtCommerce.sql' ) ; $ manager = $ this -> getManager ( ) ; $ application = new Application ( $ kernel ) ; $ application -> add ( new ImportFullCommand ( ) ) ; $ command = $ application -> find ( 'ongr:import:full' ) ; $ commandTester = new CommandTester ( $ command ) ; $ commandTester -> execute ( [ 'command' => $ command -> getName ( ) ] ) ; $ actualDocuments = [ ] ; foreach ( $ this -> repositories as $ key ) { $ repository = $ manager -> getRepository ( $ key ) ; usleep ( 90000 ) ; foreach ( $ repository -> execute ( new Search ( ) , Repository :: RESULTS_ARRAY ) as $ item ) { $ actualDocuments [ $ key ] [ ] = $ item ; } } foreach ( $ this -> repositories as $ key ) { sort ( $ actualDocuments [ $ key ] ) ; sort ( $ this -> expectedDocuments [ $ key ] ) ; } $ this -> assertEquals ( $ this -> expectedDocuments , $ actualDocuments ) ; }
Tests import functionality from xtCommerce.
Tests import functionality from xtCommerce .
// Temporary workaround for ESB issue #34 (https://github.com/ongr-io/ElasticsearchBundle/issues/34).