silverstripe-framework/tests/php/ORM/VersionableExtensionsTest.php

34 lines
917 B
PHP
Raw Normal View History

2016-02-23 21:53:52 +01:00
<?php
2016-10-14 03:30:05 +02:00
namespace SilverStripe\ORM\Tests;
use SilverStripe\ORM\DB;
use SilverStripe\Dev\SapphireTest;
2016-02-23 21:53:52 +01:00
class VersionableExtensionsTest extends SapphireTest
{
protected static $fixture_file = 'VersionableExtensionsFixtures.yml';
protected $extraDataObjects = array(
2016-10-14 03:30:05 +02:00
VersionableExtensionsTest\TestObject::class,
2016-02-23 21:53:52 +01:00
);
public function testTablesAreCreated()
{
$tables = DB::table_list();
$check = array(
'versionableextensionstest_dataobject_test1_live', 'versionableextensionstest_dataobject_test2_live', 'versionableextensionstest_dataobject_test3_live',
'versionableextensionstest_dataobject_test1_versions', 'versionableextensionstest_dataobject_test2_versions', 'versionableextensionstest_dataobject_test3_versions'
);
// Check that the right tables exist
foreach ($check as $tableName) {
$this->assertContains($tableName, array_keys($tables), 'Contains table: '.$tableName);
}
}
}