tests/SchemaTest.php
/**
     * @dataProvider pdoAttributesProviderTrait
     *
     * @param array $pdoAttributes
     *
     * @throws Exception
     * @throws InvalidConfigException
     */
@dataProvider pdoAttributesProviderTrait
@param array $pdoAttributes

@throws Exception
@throws InvalidConfigException
@dataProvider pdoAttributesProviderTrait @param array $pdoAttributes @throws Exception @throws InvalidConfigException
public function testGetTableNames(array $pdoAttributes): void
    {
        $db = $this->getConnection(true);
        foreach ($pdoAttributes as $name => $value) {
            $db->getPDO()->setAttribute($name, $value);
        }
        $schema = $db->getSchema();
        $tables = $schema->getTableNames();
        if ($db->getDriverName() === 'sqlsrv') {
            $tables = array_map(static function ($item) {
                return trim($item, '[]');
            }, $tables);
        }
        $this->assertContains('customer', $tables);
        $this->assertContains('category', $tables);
        $this->assertContains('item', $tables);
        $this->assertContains('order', $tables);
        $this->assertContains('order_item', $tables);
        $this->assertContains('type', $tables);
        $this->assertContains('animal', $tables);
        $this->assertContains('animal_view', $tables);
    }
public function testGetTableNames ( array $ pdoAttributes ) : void { $ db = $ this -> getConnection ( true ) ; foreach ( $ pdoAttributes as $ name => $ value ) { $ db -> getPDO ( ) -> setAttribute ( $ name , $ value ) ; } $ schema = $ db -> getSchema ( ) ; $ tables = $ schema -> getTableNames ( ) ; if ( $ db -> getDriverName ( ) === 'sqlsrv' ) { $ tables = array_map ( static function ( $ item ) { return trim ( $ item , '[]' ) ; } , $ tables ) ; } $ this -> assertContains ( 'customer' , $ tables ) ; $ this -> assertContains ( 'category' , $ tables ) ; $ this -> assertContains ( 'item' , $ tables ) ; $ this -> assertContains ( 'order' , $ tables ) ; $ this -> assertContains ( 'order_item' , $ tables ) ; $ this -> assertContains ( 'type' , $ tables ) ; $ this -> assertContains ( 'animal' , $ tables ) ; $ this -> assertContains ( 'animal_view' , $ tables ) ; }
@dataProvider pdoAttributesProviderTrait
 @param array $pdoAttributes
@dataProvider pdoAttributesProviderTrait @param array $pdoAttributes