1 | <?php |
||
18 | class SetCollectionTest extends UnitTestCase |
||
19 | { |
||
20 | public function testSetWillSetValueOnCollectionInPlace() |
||
21 | { |
||
22 | $exp = $this->fixtures['assoc']; |
||
23 | $coll = Factory::create($exp); |
||
24 | $this->assertEquals($exp, $coll->toArray()); |
||
25 | $this->assertSame($coll, $coll->set('1st', 'worst'), 'Collection::set() should return the collection itself.'); |
||
26 | $exp['1st'] = 'worst'; |
||
27 | $this->assertEquals($exp, $coll->toArray()); |
||
28 | $coll->set('first', 'worst'); |
||
29 | $exp['first'] = 'worst'; |
||
30 | $this->assertEquals($exp, $coll->toArray()); |
||
31 | } |
||
32 | } |
||
33 |