Hello everybody,
First of all, I wish you all a happy new year.
I'm having a testing problem and I hope you can help me with that since I have
not found anything useful so far.
I am currently writing my first tests and I do not know how to deal with the
case if a method calls its parent method.
How can you test something like that? I do not want to test the code of all
parent classes.
Especially, more and more parents are added per module.
Example:
class test__newsletter extends test__newsletter_parent
{
public function send()
{
parent::send();
if ($this->_iNewsletterStatus === 1 || $this->_iNewsletterStatus === 2) {
$aParams = oxRegistry::getConfig()->getRequestParameter("editval");
$this->getUtils()->callTestAsync(
test_aws_api_constants::EVENT_OXID_NL_FORM_DOI,
$aParams['oxuser__oxusername']
)
;
}
}
Is it possible to mock the parent call?
Thank you very much and greetings
Markus