Completed
Pull Request — master (#73)
by Mike
04:55
created

DripperTest   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 5
c 3
b 0
f 0
dl 0
loc 45
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A testUrlAttributeValue() 0 7 1
A testIntervalAttributeValue() 0 7 1
A testAgeCheckIntervalAttributeValue() 0 7 1
A testAgeThresholdAttributeValue() 0 7 1
A testHtmlAttributeValue() 0 7 1
1
<?php namespace GeneaLabs\LaravelCaffeine\Tests\Unit\Providers;
2
3
use Exception;
4
use GeneaLabs\LaravelCaffeine\Dripper;
5
use GeneaLabs\LaravelCaffeine\Tests\TestCase;
6
use Illuminate\Foundation\Testing\RefreshDatabase;
7
8
class DripperTest extends TestCase
9
{
10
    public function testAgeCheckIntervalAttributeValue()
11
    {
12
        $expectedResult = 2000;
13
14
        $actualResult = (new Dripper)->ageCheckInterval;
1 ignored issue
show
Bug Best Practice introduced by
The property ageCheckInterval does not exist on GeneaLabs\LaravelCaffeine\Dripper. Since you implemented __get, consider adding a @property annotation.
Loading history...
15
16
        $this->assertEquals($expectedResult, $actualResult);
17
    }
18
19
    public function testAgeThresholdAttributeValue()
20
    {
21
        $expectedResult = 7080000;
22
23
        $actualResult = (new Dripper)->ageThreshold;
1 ignored issue
show
Bug Best Practice introduced by
The property ageThreshold does not exist on GeneaLabs\LaravelCaffeine\Dripper. Since you implemented __get, consider adding a @property annotation.
Loading history...
24
25
        $this->assertEquals($expectedResult, $actualResult);
26
    }
27
28
    public function testUrlAttributeValue()
29
    {
30
        $expectedResult = "/genealabs/laravel-caffeine/drip";
31
32
        $actualResult = (new Dripper)->url;
1 ignored issue
show
Bug Best Practice introduced by
The property url does not exist on GeneaLabs\LaravelCaffeine\Dripper. Since you implemented __get, consider adding a @property annotation.
Loading history...
33
34
        $this->assertEquals($expectedResult, $actualResult);
35
    }
36
37
    public function testIntervalAttributeValue()
38
    {
39
        $expectedResult = 300000;
40
41
        $actualResult = (new Dripper)->interval;
1 ignored issue
show
Bug Best Practice introduced by
The property interval does not exist on GeneaLabs\LaravelCaffeine\Dripper. Since you implemented __get, consider adding a @property annotation.
Loading history...
42
43
        $this->assertEquals($expectedResult, $actualResult);
44
    }
45
46
    public function testHtmlAttributeValue()
47
    {
48
        $expectedResult = file_get_contents(__DIR__ . '/../Fixtures/unexpired_script.txt');
49
50
        $actualResult = (new Dripper)->html;
1 ignored issue
show
Bug Best Practice introduced by
The property html does not exist on GeneaLabs\LaravelCaffeine\Dripper. Since you implemented __get, consider adding a @property annotation.
Loading history...
51
52
        $this->assertEquals($actualResult, $expectedResult);
53
    }
54
}
55