Open Grummfy opened 7 years ago
We got feedback that we can improve the documentation on mock, and overall on the usage of assertion from anonymous function inside it.
see https://github.com/btry/flyve-mdm-glpi-plugin/blob/feature/atoum-ize_tests/tests/suite-integration/PluginFlyvemdmAgent.php#L399-412
$mockedAgent->getMockController()->notify = function($topic, $mqttMessage, $qos = 0, $retain = 0) use ($tester, &$mockedAgent) { $tester->string($topic)->isEqualTo($mockedAgent->getTopic() . "/Command/Unenroll"); $tester->string($mqttMessage)->isEqualTo(json_encode(['unenroll' => 'now'], JSON_UNESCAPED_SLASHES)); $tester->integer($qos)->isEqualTo(0); $tester->integer($retain)->isEqualTo(1); }; $mockedAgent->update([ 'id' => $mockedAgent->getID(), '_unenroll' => '', ]); $this->mock($mockedAgent)->call('notify')->once();
see @btry to see if the documentation helps or not
wait until https://github.com/atoum/atoum/pull/744 is merged
We got feedback that we can improve the documentation on mock, and overall on the usage of assertion from anonymous function inside it.
see https://github.com/btry/flyve-mdm-glpi-plugin/blob/feature/atoum-ize_tests/tests/suite-integration/PluginFlyvemdmAgent.php#L399-412
see @btry to see if the documentation helps or not