From 9b3763a203aa8d927ab2300c30d1579a48eabce7 Mon Sep 17 00:00:00 2001 From: = Date: Sat, 7 Aug 2021 19:56:56 +1000 Subject: [PATCH] Tests for email quotas --- .../Feature/Account/AccountEmailQuotaTest.php | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 tests/Feature/Account/AccountEmailQuotaTest.php diff --git a/tests/Feature/Account/AccountEmailQuotaTest.php b/tests/Feature/Account/AccountEmailQuotaTest.php new file mode 100644 index 000000000000..efd89b9190fa --- /dev/null +++ b/tests/Feature/Account/AccountEmailQuotaTest.php @@ -0,0 +1,62 @@ +faker = Factory::create(); + $this->buildCache(true); + $this->makeTestData(); + } + + public function testQuotaValidRule() + { + Cache::increment($this->account->key); + + $this->assertFalse($this->account->emailQuotaExceeded()); + } + + + public function testQuotaInValidRule() + { + Cache::increment($this->account->key, 3000); + + $this->assertTrue($this->account->emailQuotaExceeded()); + } + +}