forked from FriendsOfSymfony1/doctrine1
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added testcase for pr FriendsOfSymfony1#110
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
class Doctrine_Ticket_gh110_TestCase extends Doctrine_UnitTestCase | ||
{ | ||
public function testAddActAsColumnsToDocBlock() | ||
{ | ||
$builder = new Doctrine_Import_Builder(); | ||
$class = $builder->buildDefinition( | ||
array( | ||
'className' => 'Ticket_gh110_TestRecord', | ||
'topLevelClassName' => 'Ticket_gh110_TestRecord', | ||
'is_base_class' => true, | ||
'columns' => array( | ||
'id' => array( | ||
'type' => 'integer', | ||
'length' => 4, | ||
) | ||
), | ||
'actAs' => array( | ||
'SoftDelete' => array(), | ||
'Timestampable' => array(), | ||
) | ||
) | ||
); | ||
|
||
$this->assertTrue(preg_match('/@property int\s*\$id/', $class)); | ||
$this->assertTrue(preg_match('/@property string\s*\$deleted_at/', $class)); | ||
$this->assertTrue(preg_match('/@property string\s*\$created_at/', $class)); | ||
$this->assertTrue(preg_match('/@property string\s*\$updated_at/', $class)); | ||
} | ||
} |