Skip to content

Commit

Permalink
Refactored tests - now there a less failures!
Browse files Browse the repository at this point in the history
  • Loading branch information
uwej711 committed Oct 22, 2011
1 parent c0add99 commit a95037f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 77 deletions.
33 changes: 16 additions & 17 deletions tests/Doctrine/Tests/ODM/PHPCR/Functional/HierarchyTest.php
Expand Up @@ -62,52 +62,51 @@ public function testInsert()
}

/**
* @depends testFind
* @expectedException Doctrine\ODM\PHPCR\PHPCRException
*/
public function testNodenameChangeException($doc)
public function testNodenameChangeException()
{
$doc = $this->dm->find($this->type, '/functional/thename');
$doc->nodename = 'x';
$this->dm->flush();
}

/**
* @depends testFind
* @expectedException Doctrine\ODM\PHPCR\PHPCRException
*/
public function testParentChangeException($doc)
public function testParentChangeException()
{
$doc = $this->dm->find($this->type, '/functional/thename');
$doc->parent = new NameDoc();
$this->dm->flush();
}

/**
* @depends testFind
* @expectedException Doctrine\ODM\PHPCR\PHPCRException
*/
public function testIdChangeException($doc)
public function testIdChangeException()
{
$doc = $this->dm->find($this->type, '/functional/thename');
$doc->id = '/different';
$this->dm->flush();
}

/*
* TODO: implement a strategy for this. should probably even be the default
public function testInsertWithParentAndNameIdStrategy()
public function testInsertWithParentIdStrategy()
{
$user = new User3();
$user->username = "test3";
$doc = $this->dm->find($this->type, '/functional/thename');
$child = new NameDoc();
$child->parent = $doc;
$child->nodename = 'child';

$this->dm->persist($child);

$this->dm->persist($user);
$this->dm->flush();
$this->dm->clear();

$userNew = $this->dm->find('Doctrine\Tests\ODM\PHPCR\Functional\User3', '/functional/test3');
$this->assertTrue($this->node->getNode('thename')->hasNode('child'));
$this->assertEquals('/functional/thename/child', $child->id);

$this->assertNotNull($userNew, "Have to hydrate user object!");
$this->assertEquals($user->username, $userNew->username);
}
*/

// TODO: move? is to be done through phpcr session directly

}
Expand Down
60 changes: 0 additions & 60 deletions tests/Doctrine/Tests/ODM/PHPCR/Functional/ParentTest.php

This file was deleted.

0 comments on commit a95037f

Please sign in to comment.