@@ 32-42 (lines=11) @@ | ||
29 | $this->config = \Yii::$container->get(TokenRepositoryConfig::class); |
|
30 | } |
|
31 | ||
32 | public function testExpire() |
|
33 | { |
|
34 | putenv("{$this->config->expirePeriodKey}=0"); |
|
35 | ||
36 | $this->config->defaultExpirePeriod = $expirePeriod = mt_rand(1, 10); |
|
37 | $this->assertEquals($expirePeriod, $this->config->getExpirePeriod()->minutes); |
|
38 | ||
39 | $this->config->defaultExpirePeriod = 0; |
|
40 | putenv("{$this->config->expirePeriodKey}={$expirePeriod}"); |
|
41 | $this->assertEquals($expirePeriod, $this->config->getExpirePeriod()->minutes); |
|
42 | } |
|
43 | ||
44 | public function testDeliveryLimit() |
|
45 | { |
|
@@ 44-54 (lines=11) @@ | ||
41 | $this->assertEquals($expirePeriod, $this->config->getExpirePeriod()->minutes); |
|
42 | } |
|
43 | ||
44 | public function testDeliveryLimit() |
|
45 | { |
|
46 | putenv("{$this->config->deliveryLimitKey}=0"); |
|
47 | ||
48 | $this->config->defaultDeliveryLimit = $deliveryLimit = mt_rand(1, 10); |
|
49 | $this->assertEquals($deliveryLimit, $this->config->getDeliveryLimit()); |
|
50 | ||
51 | $this->config->defaultDeliveryLimit = 0; |
|
52 | putenv("{$this->config->deliveryLimitKey}={$deliveryLimit}"); |
|
53 | $this->assertEquals($deliveryLimit, $this->config->getDeliveryLimit()); |
|
54 | } |
|
55 | ||
56 | public function testVerifyLimit() |
|
57 | { |
|
@@ 56-66 (lines=11) @@ | ||
53 | $this->assertEquals($deliveryLimit, $this->config->getDeliveryLimit()); |
|
54 | } |
|
55 | ||
56 | public function testVerifyLimit() |
|
57 | { |
|
58 | putenv("{$this->config->verifyLimitKey}=0"); |
|
59 | ||
60 | $this->config->defaultVerifyLimit = $verifyLimit = mt_rand(1, 10); |
|
61 | $this->assertEquals($verifyLimit, $this->config->getVerifyLimit()); |
|
62 | ||
63 | $this->config->defaultVerifyLimit = 0; |
|
64 | putenv("{$this->config->verifyLimitKey}={$verifyLimit}"); |
|
65 | $this->assertEquals($verifyLimit, $this->config->getVerifyLimit()); |
|
66 | } |
|
67 | ||
68 | } |
|
69 |