/** * @expectedException \Magento\Framework\Exception\LocalizedException * @expectedExceptionMessage This is an invalid subscription confirmation code. */ public function testUnsubscribeException() { $this->subscriber->setCode(111); $this->subscriber->setCheckCode(222); $this->subscriber->unsubscribe(); }