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

it_should_use_default_values_to_connect_to_the_database() public method

    public function it_should_use_default_values_to_connect_to_the_database()
    {
        $application = new Application();
        /** @var \tad\WPBrowser\Services\Db\MySQLDumpFactoryInterface $pdoFactory */
        $pdoFactory = $this->prophesize('\\tad\\WPBrowser\\Services\\Db\\MySQLDumpFactoryInterface');
        $expectedHost = 'localhost';
        $expectedUser = 'root';
        $expectedPassword = 'root';
        $expectedDb = 'db';
        $pdoFactory->makeDump($expectedHost, $expectedUser, $expectedPassword, $expectedDb)->willReturn(false);
        $application->add(new DbSnapshot(null, $pdoFactory->reveal()));
        $command = $application->find('db:snapshot');
        $commandTester = new CommandTester($command);
        $commandTester->execute(['command' => $command->getName(), 'name' => 'db', 'snapshot' => 'someSnapshot']);
    }