Test Failed
Push — master ( 3a2408...8f3679 )
by Nur
03:38
created

CounterTest::a_create_name_key_only()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 9
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Turahe\Counters\Tests;
4
5
use Turahe\Counters\Models\Counter;
6
7
class CounterTest extends TestCase
8
{
9
    /** @test */
10
    public function a_counter_can_seed_simple_test()
11
    {
12
        // create Counters
13
        //This will create a counter with inital value as 3, and every increment 5 will be added.
14
        $counter = Counter::create([
15
            'key' => 'number_of_downloads',
16
            'name' => 'Visitors',
17
            'initial_value' => 3,
18
            'step' => 5
19
        ]);
20
21
        $this->assertEquals('number_of_downloads', $counter->key);
22
        $this->assertEquals('Visitors', $counter->name);
23
        $this->assertEquals(3, $counter->initial_value);
24
        $this->assertEquals(5, $counter->step);
25
    }
26
    /** @test */
27
    public function a_create_name_key_only()
28
    {
29
        $counter = Counter::create([
30
            'key' => 'number_of_downloads',
31
            'name' => 'Visitors',
32
        ]);
33
34
        $this->assertEquals('number_of_downloads', $counter->key);
35
        $this->assertEquals('Visitors', $counter->name);
36
    }
37
38
}