public function testAddFilterAfterNoFilterFound() { $usertext = new CM_Usertext_Usertext(); $exception = $this->catchException(function () use($usertext) { $usertext->addFilterAfter('Filter Not Set', new CM_Usertext_Filter_Emoticon()); }); $this->assertInstanceOf('CM_Exception_Invalid', $exception); /** @var CM_Exception_Invalid $exception */ $this->assertSame('Filter not found', $exception->getMessage()); $this->assertSame(['filter' => 'Filter Not Set'], $exception->getMetaInfo()); }