Skip to content

Commit

Permalink
Add LTS test to v4.
Browse files Browse the repository at this point in the history
  • Loading branch information
gabordemooij committed Apr 2, 2014
1 parent 662052b commit 06b8b38
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions testing/RedUNIT/Base/Aliasing.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,29 @@
*/
class Aliasing extends Base
{
/**
* Test for aliasing issue for LTS version.
*
* @return void
*/
public function testIssueAliasingForLTSVersion() {
$person = R::dispense('person');
$pro = R::dispense('project');
$c = R::dispense('course');
$person->name = 'x';
$person->alias('teacher')->ownProject[] = $pro;
$person->alias('student')->ownCourse[] = $c;
R::store($person);
asrt($c->fresh()->fetchAs('person')->student->name, 'x');
asrt($pro->fresh()->fetchAs('person')->teacher->name, 'x');
$person = $person->fresh();
$person->alias('teacher')->ownProject = array();
$person->alias('student')->ownCourse = array();
R::store($person);
asrt($c->fresh()->fetchAs('person')->student, NULL);
asrt($pro->fresh()->fetchAs('person')->teacher, NULL);
}

/**
* Describing how clearing state of bean works.
* Every method returning somthing (except getID)
Expand Down

0 comments on commit 06b8b38

Please sign in to comment.