fix errors

This commit is contained in:
qfrery
2018-07-16 10:44:13 +01:00
parent 8f05d88567
commit 2f83a74b95

View File

@@ -107,25 +107,25 @@ class AnalyticsTest extends \MailPoetTest {
$fakePublicId = 'alk-ded-egrg-zaz-fvf-rtr-zdef';
$analytics->setPublicId($fakePublicId);
expect(Setting::getValue('public_id'))->equals($fakePublicId);
expect($analytics->getValue('public_id'))->equals($fakePublicId);
}
function testIsPublicIdNew() {
$analytics = new Analytics(new Reporter());
$fakePublicId = 'alk-ded-egrg-zaz-fvf-rtr-zdef';
Setting::setValue('new_public_id', 'false');
$analytics->setValue('new_public_id', 'false');
$analytics->setPublicId($fakePublicId);
// When we update public_id it's marked as new
expect(Setting::getValue('new_public_id'))->equals('true');
expect(Setting::isPublicIdNew())->true();
expect(Setting::getValue('new_public_id'))->equals('false');
expect($analytics->getValue('new_public_id'))->equals('true');
expect($analytics->isPublicIdNew())->true();
expect($analytics->getValue('new_public_id'))->equals('false');
$analytics->setPublicId($fakePublicId);
// We tried to update public_id with the same value, so it's not marked as new
expect(Setting::getValue('new_public_id'))->equals('false');
expect(Setting::isPublicIdNew())->false();
expect(Setting::getValue('new_public_id'))->equals('false');
expect($analytics->getValue('new_public_id'))->equals('false');
expect($analytics->isPublicIdNew())->false();
expect($analytics->getValue('new_public_id'))->equals('false');
}
}