Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Test Failed
Push — add-more-tests ( 5019ae...3f486c )
by Pedro
09:43 queued 08:21
created

CrudPanelDeleteTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 14
c 0
b 0
f 0
dl 0
loc 31
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testDeleteUnknown() 0 8 1
A testDelete() 0 13 1
A testItAddsTheBulkDeleteButton() 0 4 1
1
<?php
2
3
namespace Backpack\CRUD\Tests\Unit\CrudPanel;
4
5
use Backpack\CRUD\Tests\Unit\Models\Article;
6
use Illuminate\Database\Eloquent\ModelNotFoundException;
7
use Illuminate\Support\Facades\DB;
8
9
/**
10
 * @covers Backpack\CRUD\app\Library\CrudPanel\Traits\Delete
11
 */
12
class CrudPanelDeleteTest extends BaseDBCrudPanelTest
13
{
14
    public function testDelete()
15
    {
16
        $this->markTestIncomplete('Not correctly implemented');
17
18
        $this->crudPanel->setModel(Article::class);
19
        $article = Article::find(1);
20
21
        $wasDeleted = $this->crudPanel->delete($article->id);
22
23
        // TODO: the delete method should not convert the returned result to a string
24
        $deletedArticle = Article::find(1);
25
        $this->assertTrue($wasDeleted);
26
        $this->assertNull($deletedArticle);
27
    }
28
29
    public function testDeleteUnknown()
30
    {
31
        $this->expectException(ModelNotFoundException::class);
32
33
        $this->crudPanel->setModel(Article::class);
34
        $unknownId = DB::getPdo()->lastInsertId() + 1;
35
36
        $this->crudPanel->delete($unknownId);
37
    }
38
39
    public function testItAddsTheBulkDeleteButton()
40
    {
41
        $this->crudPanel->addBulkDeleteButton();
42
        $this->assertCount(1, $this->crudPanel->buttons());
43
    }
44
}
45