public function test_onlyelement_fail() { $arc = new ArrayCollection(array('aap', 'noot')); $this->setExpectedException('SAML2\\Exception\\RuntimeException', 'SAML2\\Utilities\\ArrayCollection::SAML2\\Utilities\\ArrayCollection::getOnlyElement requires that the collection has exactly one element, "2" elements found'); $arc->getOnlyElement(); }