-
Notifications
You must be signed in to change notification settings - Fork 417
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #569 from nibsirahsieu/fix_set_descendant_class
fix set descendant class
- Loading branch information
Showing
3 changed files
with
53 additions
and
1 deletion.
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
41 changes: 41 additions & 0 deletions
41
...ite/generator/behavior/concrete_inheritance/ConcreteInheritanceBehaviorNamespacedTest.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,41 @@ | ||
<?php | ||
|
||
/* | ||
* $Id: ConcreteInheritanceBehaviorNamespacedTest.php 1458 2010-01-13 16:09:51Z francois $ | ||
* 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__) . '/../../../../tools/helpers/namespaces/NamespacesTestBase.php'; | ||
|
||
/** | ||
* Tests for ConcreteInheritanceBehaviorNamespacedTest class | ||
* | ||
* @author François Zaniontto | ||
* @version $Revision$ | ||
* @package generator.behavior.concrete_inheritance | ||
*/ | ||
class ConcreteInheritanceBehaviorNamespacedTest extends NamespacesTestBase | ||
{ | ||
public function testgetParentOrCreateWithPrimaryKeyIsNull() | ||
{ | ||
$concreteArticle = new \Foo\Bar\NamespacedConcreteArticle(); | ||
$concreteArticle->setTitle('Foo'); | ||
$concreteArticle->setBody('Bar'); | ||
$parent = $concreteArticle->getParentOrCreate(); | ||
$this->assertEquals('Foo\Bar\NamespacedConcreteArticle', $parent->getDescendantClass(), 'getDescendantClass() will return Foo\Bar\NamespacedConcreteArticle'); | ||
} | ||
|
||
public function testgetParentOrCreateWithPrimaryKeyNotNull() | ||
{ | ||
$concreteArticle = new \Foo\Bar\NamespacedConcreteArticle(); | ||
$concreteArticle->setPrimaryKey(1); | ||
$concreteArticle->setTitle('Foo'); | ||
$concreteArticle->setBody('Bar'); | ||
$parent = $concreteArticle->getParentOrCreate(); | ||
$this->assertEquals('Foo\Bar\NamespacedConcreteArticle', $parent->getDescendantClass(), 'getDescendantClass() will return Foo\Bar\NamespacedConcreteArticle'); | ||
} | ||
} |