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

it_should_dump_the_database_to_the_data_folder_by_default() public method

    public function it_should_dump_the_database_to_the_data_folder_by_default()
    {
        $expectedDump = codecept_data_dir('issue4455.sql');
        $expectedDistDump = codecept_data_dir('issue4455.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']);
    }