2016-02-23 21:53:52 +01:00
|
|
|
<?php
|
2016-06-15 06:03:16 +02:00
|
|
|
|
2016-10-14 03:30:05 +02:00
|
|
|
namespace SilverStripe\ORM\Tests;
|
|
|
|
|
2016-06-15 06:03:16 +02:00
|
|
|
use SilverStripe\ORM\DB;
|
2016-08-19 00:51:35 +02:00
|
|
|
use SilverStripe\Dev\SapphireTest;
|
2016-02-23 21:53:52 +01:00
|
|
|
|
|
|
|
class VersionableExtensionsTest extends SapphireTest
|
|
|
|
{
|
2016-12-16 05:34:21 +01:00
|
|
|
protected static $fixture_file = 'VersionableExtensionsFixtures.yml';
|
|
|
|
|
|
|
|
protected $extraDataObjects = array(
|
|
|
|
VersionableExtensionsTest\TestObject::class,
|
|
|
|
);
|
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
2016-02-23 21:53:52 +01:00
|
|
|
}
|