|
@@ 11-23 (lines=13) @@
|
| 8 |
|
|
| 9 |
|
class TdbmFluidTableTest extends TestCase |
| 10 |
|
{ |
| 11 |
|
public function testColumn() |
| 12 |
|
{ |
| 13 |
|
$schema = new Schema(); |
| 14 |
|
$fluid = new TdbmFluidSchema($schema); |
| 15 |
|
|
| 16 |
|
$posts = $fluid->table('posts'); |
| 17 |
|
|
| 18 |
|
$column = $posts->column('foo'); |
| 19 |
|
|
| 20 |
|
$this->assertTrue($schema->getTable('posts')->hasColumn('foo')); |
| 21 |
|
|
| 22 |
|
$this->assertSame($column, $posts->column('foo'), 'Failed asserting that the same instance is returned.'); |
| 23 |
|
} |
| 24 |
|
|
| 25 |
|
public function testExistingColumn() |
| 26 |
|
{ |
|
@@ 126-137 (lines=12) @@
|
| 123 |
|
$this->assertSame("\n@Bean(name = \"Article\")", $schema->getTable('posts')->getOptions()['comment']); |
| 124 |
|
} |
| 125 |
|
|
| 126 |
|
public function testImplementsInterface() |
| 127 |
|
{ |
| 128 |
|
$schema = new Schema(); |
| 129 |
|
$fluid = new TdbmFluidSchema($schema); |
| 130 |
|
|
| 131 |
|
$posts = $fluid->table('posts'); |
| 132 |
|
|
| 133 |
|
$posts->implementsInterface('Foo\\Bar'); |
| 134 |
|
$posts->implementsInterface('Foo\\Bar2'); |
| 135 |
|
|
| 136 |
|
$this->assertSame("\n@AddInterface(name = \"Foo\\Bar\")\n@AddInterface(name = \"Foo\\Bar2\")", $schema->getTable('posts')->getOptions()['comment']); |
| 137 |
|
} |
| 138 |
|
|
| 139 |
|
public function testImplementsInterfaceOnDao() |
| 140 |
|
{ |
|
@@ 151-162 (lines=12) @@
|
| 148 |
|
$this->assertSame("\n@AddInterfaceOnDao(name = \"Foo\\Bar\")", $schema->getTable('posts')->getOptions()['comment']); |
| 149 |
|
} |
| 150 |
|
|
| 151 |
|
public function testUseTrait() |
| 152 |
|
{ |
| 153 |
|
$schema = new Schema(); |
| 154 |
|
$fluid = new TdbmFluidSchema($schema); |
| 155 |
|
|
| 156 |
|
$posts = $fluid->table('posts'); |
| 157 |
|
|
| 158 |
|
$posts->useTrait('Foo\\Bar'); |
| 159 |
|
$posts->useTrait('Foo\\Bar2'); |
| 160 |
|
|
| 161 |
|
$this->assertSame("\n@AddTrait(name = \"Foo\\Bar\", modifiers = {})\n@AddTrait(name = \"Foo\\Bar2\", modifiers = {})", $schema->getTable('posts')->getOptions()['comment']); |
| 162 |
|
} |
| 163 |
|
|
| 164 |
|
public function testUseTraitOnDao() |
| 165 |
|
{ |