Skip to content

Commit

Permalink
Added testcase for pr FriendsOfSymfony1#110
Browse files Browse the repository at this point in the history
  • Loading branch information
thirsch committed Jan 23, 2024
1 parent 4af8b67 commit 7dfd205
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/Ticket/gh110TestCase.php
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));
}
}

0 comments on commit 7dfd205

Please sign in to comment.