Permalink
Browse files

Fixed tests setup

  • Loading branch information...
1 parent 8cb2101 commit d0b95221f0add4968d29a67056a7dcc0252dbd5e @willdurand willdurand committed Jun 29, 2012
Showing with 18 additions and 11 deletions.
  1. +15 −1 tests/EqualNestBehaviorTest.php
  2. +1 −9 tests/TestCase.php
  3. +2 −1 tests/bootstrap.php
@@ -7,13 +7,27 @@ class EqualNestBehaviorTest extends TestCase
{
protected function setUp()
{
- if (!class_exists('')) {
+ if (!class_exists('Person')) {
$schema = <<<XML
<database name="equal_nest_behavior">
+ <table name="person">
+ <column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
+ <column name="name" type="VARCHAR" required="true" />
+ </table>
+
+ <table name="friend">
+ <behavior name="equal_nest">
+ <parameter name="parent_table" value="person" />
+ </behavior>
+ </table>
</database>
XML;
}
$this->getBuilder($schema)->build();
}
+
+ public function testObjectMethods()
+ {
+ }
}
View
@@ -5,19 +5,11 @@
*/
class TestCase extends \PHPUnit_Framework_TestCase
{
- public function assertSQLContains($tablename, $options, $expected)
- {
- $schema = $this->generateSchema($tablename, $options);
- $builder = $this->getBuilder($schema);
-
- $this->assertContains($expected, $builder->getSQL());
- }
-
protected function getBuilder($schema)
{
$builder = new PropelQuickBuilder();
$config = $builder->getConfig();
- $config->setBuildProperty('behavior.publishable.class', __DIR__ . '/../src/EqualNestBehavior');
+ $config->setBuildProperty('behavior.equal_nest.class', '../src/EqualNestBehavior');
$builder->setConfig($config);
$builder->setSchema($schema);
View
@@ -1,7 +1,8 @@
<?php
$loader = require_once __DIR__ . '/../vendor/autoload.php';
-$loader->add('', __DIR__ . '/../vendor/propel/propel1/generator/lib/util/PropelQuickBuilder.php');
$loader->add('', __DIR__);
set_include_path(__DIR__ . '/../vendor/phing/phing/classes' . PATH_SEPARATOR . get_include_path());
+
+require_once __DIR__ . '/../vendor/propel/propel1/generator/lib/util/PropelQuickBuilder.php';

0 comments on commit d0b9522

Please sign in to comment.