N98\Magento\Command\Database\DumpCommandTest::testWithStripOption PHP Method

testWithStripOption() public method

public testWithStripOption ( )
    public function testWithStripOption()
    {
        $command = $this->getCommand();
        $this->getApplication()->initMagento();
        $commandTester = new CommandTester($command);
        $commandTester->execute(array('command' => $command->getName(), '--add-time' => true, '--only-command' => true, '--force' => true, '--strip' => '@development not_existing_table_1', '--compression' => 'gzip'));
        $dbConfig = $this->getDatabaseConnection()->getConfig();
        $db = $dbConfig['dbname'];
        $this->assertRegExp("/--ignore-table={$db}.customer_entity/", $commandTester->getDisplay());
        $this->assertRegExp("/--ignore-table={$db}.customer_address_entity/", $commandTester->getDisplay());
        $this->assertRegExp("/--ignore-table={$db}.sales_flat_order/", $commandTester->getDisplay());
        $this->assertRegExp("/--ignore-table={$db}.sales_flat_order_item/", $commandTester->getDisplay());
        $this->assertRegExp("/--ignore-table={$db}.sales_flat_order_item/", $commandTester->getDisplay());
        $this->assertNotContains("not_existing_table_1", $commandTester->getDisplay());
        $this->assertContains(".sql.gz", $commandTester->getDisplay());
        /**
         * Uncompressed
         */
        $commandTester = new CommandTester($command);
        $commandTester->execute(array('command' => $command->getName(), '--add-time' => true, '--only-command' => true, '--force' => true, '--strip' => '@development'));
        $this->assertNotContains(".sql.gz", $commandTester->getDisplay());
    }