Completed
Pull Request — master (#372)
by Mike
31:01 queued 16:07
created

IncrementTest::testIncrementingInvalidatesCache()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15

Duplication

Lines 15
Ratio 100 %

Importance

Changes 0
Metric Value
dl 15
loc 15
rs 9.7666
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php namespace GeneaLabs\LaravelModelCaching\Tests\Integration\CachedBuilder;
2
3
use GeneaLabs\LaravelModelCaching\Tests\Fixtures\Book;
4
use GeneaLabs\LaravelModelCaching\Tests\IntegrationTestCase;
5
6 View Code Duplication
class IncrementTest extends IntegrationTestCase
0 ignored issues
show
Bug introduced by
There is at least one abstract method in this class. Maybe declare it as abstract, or implement the remaining methods: artisan, be, call, seed
Loading history...
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
7
{
8
    public function testIncrementingInvalidatesCache()
9
    {
10
        $book = (new Book)
11
            ->find(1);
12
        $originalPrice = $book->price;
13
        $originalDescription = $book->description;
14
15
        $book->increment("price", 1.25, ["description" => "test description update"]);
16
        $book = (new Book)
17
            ->find(1);
18
19
        $this->assertEquals($originalPrice + 1.25, $book->price);
20
        $this->assertNotEquals($originalDescription, $book->description);
21
        $this->assertEquals($book->description, "test description update");
22
    }
23
}
24