Example #1
0
 /**
  * Call block method based on form field
  *
  * @param string $field
  * @return null|string
  */
 protected function _callBlockMethod($field)
 {
     switch ($field) {
         case 'name':
             return $this->_block->getUserName();
         case 'email':
             return $this->_block->getEmail();
         default:
             return null;
     }
 }
Example #2
0
 /**
  * @param bool $isExceedLimit
  * @param bool $result
  *
  * @dataProvider dataProviderCanSend
  */
 public function testCanSend($isExceedLimit, $result)
 {
     $this->sendfriendMock->expects($this->once())->method('isExceedLimit')->willReturn($isExceedLimit);
     $this->assertEquals($result, $this->model->canSend());
 }