forked from propelorm/Propel
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed Table::setInterface(), Table::getInterface() usages
- Loading branch information
1 parent
1fd5b18
commit f747823
Showing
4 changed files
with
50 additions
and
11 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
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
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
36 changes: 36 additions & 0 deletions
36
test/testsuite/generator/builder/om/GeneratedObjectWithInterfaceTest.php
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,36 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the Propel package. | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* @license MIT License | ||
*/ | ||
|
||
require_once dirname(__FILE__) . '/../../../../../generator/lib/util/PropelQuickBuilder.php'; | ||
|
||
class GeneratedObjectWithInterfaceTest extends PHPUnit_Framework_TestCase | ||
{ | ||
public function setUp() | ||
{ | ||
if (!class_exists('Foo\MyClassWithInterface')) { | ||
$schema = <<<EOF | ||
<database name="a-database" namespace="Foo"> | ||
<table name="my_class_with_interface" interface="MyInterface"> | ||
<column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" /> | ||
<column name="name" type="VARCHAR" /> | ||
</table> | ||
</database> | ||
EOF; | ||
$builder = new PropelQuickBuilder(); | ||
$builder->setSchema($schema); | ||
$builder->buildClasses(); | ||
} | ||
} | ||
|
||
public function testClassHasInterface() | ||
{ | ||
$this->assertInstanceOf('Foo\MyInterface', new \Foo\MyClassWithInterface()); | ||
} | ||
} |