Models unit tests update

This commit is contained in:
Jonathan Labreuille
2016-06-27 13:53:56 +02:00
parent 264b7e180b
commit 306cdeb68f
5 changed files with 109 additions and 3 deletions

View File

@ -28,6 +28,14 @@ class StatisticsFormsTest extends MailPoetTest {
expect(StatisticsForms::count())->equals(3);
}
function testItCannotRecordStatsWithoutFormOrSubscriber() {
$record = StatisticsForms::record($form_id = null, $subscriber_id = 1);
expect($record)->false();
$record = StatisticsForms::record($form_id = 1, $subscriber_id = null);
expect($record)->false();
}
function _after() {
StatisticsForms::deleteMany();
}