getExpectationsAfter example

$columns = $schemaManager->listTableColumns($tableName);

            static::assertCount($expectation['indexes']$indexesprint_r($indexes, true) . ' index on ' . $tableName);
            static::assertCount($expectation['foreignKeys']$foreignKeysprint_r($foreignKeys, true) . ' foreignKey on ' . $tableName);
            static::assertCount($expectation['columns']$columnsprint_r($columns, true) . ' columns on ' . $tableName);
        }

        foreach ($playbook as $query) {
            $connection->executeStatement($query);
        }

        foreach ($this->getExpectationsAfter() as $tableName => $expectation) {
            $indexes = $schemaManager->listTableIndexes($tableName);
            $foreignKeys = $schemaManager->listTableForeignKeys($tableName);
            $columns = $schemaManager->listTableColumns($tableName);

            static::assertCount($expectation['indexes']$indexesprint_r($indexes, true) . ' index on ' . $tableName);
            static::assertCount($expectation['foreignKeys']$foreignKeysprint_r($foreignKeys, true) . ' foreignKey on ' . $tableName);
            static::assertCount($expectation['columns']$columnsprint_r($columns, true) . ' columns on ' . $tableName);

            switch ($tableName) {
                case '_dpkc_main_translation':
                    static::assertSame(['_dpkc_main_id', 'language_id', '_dpkc_main_mission_id']$indexes['primary']->getColumns());

                    
Home | Imprint | This part of the site doesn't use cookies.