public function test_exception_should_be_thrown_by_add_collection_and_fitting_data_is_invalid() { foreach (array(null, '', 124, 123.321) as $typ) { try { $this->repo->collectionAddRimma($typ); $this->fail('expected exception ViewModelService\\Exception\\CallUndefCollectionException'); } catch (CallUndefCollectionException $e) { $this->assertStringStartsWith('Can not "add" an undefined collection "Rimma', $e->getMessage()); $this->assertStringEndsWith('collection"', $e->getMessage()); } } }