/** * 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; } }
/** * @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()); }