Codeception\Command\Tests\Unit\DbSnapshotTest::it_should_allow_specifying_dump_and_dist_file_names PHP Method

it_should_allow_specifying_dump_and_dist_file_names() public method

    public function it_should_allow_specifying_dump_and_dist_file_names()
    {
        $root = vfsStream::setup('dumps');
        $root->addChild(new vfsStreamFile('dump.sql'));
        $root->addChild(new vfsStreamFile('dump.dist.sql'));
        $expectedDump = $root->url() . '/dump.sql';
        $expectedDistDump = $root->url() . '/dump.dist.sql';
        $application = new Application();
        /** @var \tad\WPBrowser\Services\Db\MySQLDumpFactoryInterface $factory */
        $factory = $this->prophesize('\\tad\\WPBrowser\\Services\\Db\\MySQLDumpFactoryInterface');
        $dump = $this->prophesize('MySQLDump');
        $dump->write(Argument::any())->shouldBeCalled();
        $filesystem = $this->prophesize('tad\\WPBrowser\\Filesystem\\Filesystem');
        $filesystem->file_put_contents($expectedDump, Argument::type('string'))->willReturn(true);
        $filesystem->file_put_contents($expectedDistDump, Argument::type('string'))->willReturn(true);
        $factory->makeDump(Argument::type('string'), Argument::type('string'), Argument::type('string'), Argument::type('string'))->willReturn($dump->reveal());
        $application->add(new DbSnapshot(null, $factory->reveal(), $filesystem->reveal()));
        $command = $application->find('db:snapshot');
        $commandTester = new CommandTester($command);
        $commandTester->execute(['command' => $command->getName(), 'name' => 'db', 'snapshot' => 'issue4455', '--dump-file' => $expectedDump, '--dist-dump-file' => $expectedDistDump]);
    }