expectException('InvalidArgumentException'); $collection = new MigrationStepsCollection(array(1)); } public function testInvalidElements2() { $collection = new MigrationStepsCollection(array()); $this->expectException('InvalidArgumentException'); $collection[] = 'not a content'; } public function testInvalidElements3() { $collection = new MigrationStepsCollection(array()); $this->expectException('InvalidArgumentException'); $collection['test'] = true; } public function testExchangeArray() { $collection = new MigrationStepsCollection(array(new MigrationStep('test1'))); $collection->exchangeArray(array(new MigrationStep('test2'))); $this->assertEquals('test2', $collection[0]->type); $this->expectException('InvalidArgumentException'); $collection->exchangeArray(array('hello')); } }