Example #1
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     $tableRows = TableRowsProvider::provideTableRows();
     $rm = self::createDefaultRecordManager();
     self::$recordGenerator = self::saveTableRows($rm, $tableRows);
 }
Example #2
0
 protected function setUp()
 {
     parent::setUp();
     $tableRows = TableRowsProvider::provideTableRows();
     $rm = self::createDefaultRecordManager();
     $this->recordGenerator = self::saveTableRows($rm, $tableRows);
 }
Example #3
0
 protected function setUp()
 {
     parent::setUp();
     $this->schemaDefinition = (include FIXTURE_DIR . '/schema.php');
     $this->schema = new Schema($this->schemaDefinition);
     $this->schema->setValidationEnabled(true);
 }
Example #4
0
 protected function setUp()
 {
     parent::setUp();
     $this->rm = self::createDefaultRecordManager();
     $table = $this->rm->getTable('user');
     $coll = new RecordCollection($table);
     $this->userColl = $coll;
 }
Example #5
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     $databases = self::getDatabases();
     foreach ($databases as $database) {
         $rm = self::createRecordManager($database);
         $userIds = self::saveUserRecords($rm);
         self::$userIds[$rm->getConnection()->getDsn()] = $userIds;
     }
 }
Example #6
0
 public function setUp()
 {
     $tableName = 'user';
     parent::setUp();
     // table instance is always the same
     $this->table = self::createDefaultRecordManager()->getTable($tableName);
     // repository instance is always the same, too, and therefore is must be cleared in setUp()
     $this->repository = $this->table->getRepository();
     $this->repository->clear();
     $this->assertEquals($tableName, $this->repository->getTable()->getTableName());
 }
 protected function tearDown()
 {
     if ($this->storedRecord) {
         $this->rm->scheduleDelete($this->storedRecord);
     }
     if ($this->relatedRecord) {
         $this->rm->scheduleDelete($this->relatedRecord);
     }
     $this->rm->commit();
     parent::tearDown();
 }
Example #8
0
 protected function tearDown()
 {
     parent::tearDown();
     foreach ($this->revertTableForDbSchemas as $table => $conn) {
         $driver = $conn->getDriver();
         $dropMigration = $driver->createSchemaMigration($conn, $table, Migration::DROP_TABLE);
         $dropMigration->execute();
         $createMigration = $driver->createSchemaMigration($conn, $table, Migration::CREATE_TABLE);
         $createMigration->importFromSchema(self::getSchema());
         $createMigration->execute();
     }
 }
Example #9
0
 protected function setUp()
 {
     parent::setUp();
     $this->rm = self::createDefaultRecordManager();
 }
Example #10
0
 protected function setUp()
 {
     parent::setUp();
     self::$rm->clearTables();
 }
 protected function tearDown()
 {
     parent::tearDown();
     $this->rm->clearTables();
 }
Example #12
0
 protected function setUp()
 {
     parent::setUp();
     $this->generator = new FieldValuesGenerator();
 }
Example #13
0
 protected function setUp()
 {
     parent::setUp();
     $this->rm = self::createDefaultRecordManager();
     $this->table = $this->rm->getTable('user');
 }
Example #14
0
 protected function setUp()
 {
     parent::setUp();
     $this->logger = new SqlLogger();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->timestampable = new TimestampableBehavior();
 }
Example #16
0
 protected function setUp()
 {
     parent::setUp();
     $this->modelGenerator = $this->createModelGenerator();
 }
Example #17
0
 public function setUp()
 {
     parent::setUp();
     $this->rm = self::createDefaultRecordManager(self::$schemaDefinition);
 }
Example #18
0
<?php

/** @var $loader \Composer\Autoload\ClassLoader */
require __DIR__ . '/../vendor/autoload.php';
require __DIR__ . '/TestSuite/ClassLoader.php';
define('FIXTURE_DIR', __DIR__ . '/fixtures');
use Dive\TestSuite\TestCase;
echo 'PHP.version=' . PHP_VERSION . "\n";
$classLoader = new Dive\TestSuite\ClassLoader();
$classLoader->setNamespace('Dive\\TestSuite', __DIR__ . '/TestSuite');
$classLoader->setNamespaceOmission('Dive\\TestSuite');
$classLoader->register();
$databases = TestCase::getDatabases();
foreach ($databases as $database) {
    $conn = TestCase::createDatabaseConnection($database);
    $platform = $conn->getDriver()->getPlatform();
    echo get_class($platform) . '.version=' . $conn->querySingleScalar($platform->getVersionSql()) . "\n";
    $conn->disconnect();
}