PHP Classes

File: tests/GetDriverTest.php

Recommend this page to a friend!
  Packages of Scott Arciszewski   EasyDB   tests/GetDriverTest.php   Download  
File: tests/GetDriverTest.php
Role: Class source
Content type: text/plain
Description: Class source
Class: EasyDB
Simple Database Abstraction Layer around PDO
Author: By
Last change: Test Improvements + Mutation Testing (#168)

* Update testing frameworks
* Add infection for mutation tests
* Modernize PHPUnit usage
Date: 2 months ago
Size: 964 bytes
 

Contents

Class file image Download
<?php
declare(strict_types=1);

namespace
ParagonIE\EasyDB\Tests;

use
ParagonIE\EasyDB\EasyDB;
use
ParagonIE\EasyDB\Factory;
use
PHPUnit\Framework\Attributes\CoversClass;
use
PHPUnit\Framework\Attributes\DataProvider;

#[CoversClass(EasyDB::class)]
#[CoversClass(Factory::class)]
class GetDriverTest extends EasyDBTestCase
{
   
/**
     * @param string $expectedDriver
     * @param string $dsn
     * @param string|null $username
     * @param string|null $password
     * @param array $options
     *
     * @dataProvider goodFactoryCreateArgumentProvider
     */
    #[DataProvider("goodFactoryCreateArgumentProvider")]
   
public function testGetDriver(
       
string $expectedDriver,
       
string $dsn,
        ?
string $username = null,
        ?
string $password = null,
        array
$options = []
    ):
void {
       
$db = Factory::create($dsn, $username, $password, $options);
       
$this->assertEquals($db->getDriver(), $expectedDriver);
    }
}