public function testCheckContactUsFormDoesNotCheckCaptchaWhenItIsNotRequired()
 {
     $this->helperMock->expects($this->any())->method('getCaptcha')->with('contact_us')->willReturn($this->captchaMock);
     $this->captchaMock->expects($this->any())->method('isRequired')->willReturn(false);
     $this->captchaMock->expects($this->never())->method('isCorrect');
     $this->checkContactUsFormObserver->execute(new \Magento\Framework\Event\Observer());
 }
Example #2
0
 /**
  * @covers \Magento\Captcha\Model\DefaultModel::getWord
  */
 public function testGetWord()
 {
     $this->assertEquals($this->_object->getWord(), 'AbCdEf5');
     $this->_object->getSession()->setData(['user_create_word' => ['data' => 'AbCdEf5', 'expires' => time() - 360]]);
     $this->assertNull($this->_object->getWord());
 }