ParagonIE\EasyDB\Tests\EasyDBWriteTest::GoodFactoryCreateArgument2EasyDBProvider PHP Method

GoodFactoryCreateArgument2EasyDBProvider() public method

EasyDB data provider Returns an array of callables that return instances of EasyDB
See also: EasyDBTest::GoodFactoryCreateArgumentProvider()
    public function GoodFactoryCreateArgument2EasyDBProvider()
    {
        return array_map(function (array $arguments) {
            $dsn = $arguments[0];
            $username = isset($arguments[1]) ? $arguments[1] : null;
            $password = isset($arguments[2]) ? $arguments[2] : null;
            $options = isset($arguments[3]) ? $arguments[3] : [];
            return [function () use($dsn, $username, $password, $options) {
                $factory = Factory::create($dsn, $username, $password, $options);
                try {
                    $factory->run('CREATE TABLE irrelevant_but_valid_tablename (foo char(36) PRIMARY KEY)');
                } catch (Exception $e) {
                    $this->markTestSkipped($e->getMessage());
                    return null;
                }
                return $factory;
            }];
        }, $this->GoodFactoryCreateArgumentProvider());
    }