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

DripperTest::testAgeThresholdAttributeValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
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