/** * Make sure that we can replace the subjects using another collection. */ public function testReplaceSubjects() { $a = new Subject(); $b = new Subject(); $c = new Subject(); $d = new Subject(); Property::set($this->collection, 'subjects', array('a' => $a)); $collection = new Collection(); Property::set($collection, 'subjects', array('b' => $b, 'c' => $c, 'd' => $d)); $this->collection->replaceSubjects($collection); $this->assertSame(array('b' => $b, 'c' => $c, 'd' => $d), Property::get($this->collection, 'subjects'), 'The subjects should have been replaced.'); }