Completed
Pull Request — master (#49)
by
unknown
01:18
created

PackageTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 29
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A providePackageNamesAndTitles() 0 15 1
A testTitleFormatsNameCorrectly() 0 7 1
1
<?php
2
3
namespace BringYourOwnIdeas\Maintenance\Tests\Model;
4
5
use Package;
6
use SapphireTest;
7
8
class PackageTest extends SapphireTest
9
{
10
    public function providePackageNamesAndTitles()
11
    {
12
        return [
13
            ['pretendvendor/silverstripe-prefixedpackage', 'prefixedpackage'],
14
            ['pretend-vendor/silverstripe-hyphen-package', 'hyphen-package'],
15
            ['pretendvendor/somepackage', 'somepackage'],
16
            ['pretend-vendor/silverstripepackage', 'silverstripepackage'],
17
            ['pretendvendor/hyphenated-package', 'hyphenated-package'],
18
            ['silverstripe/module', 'module'],
19
            ['silverstripe/some-thing', 'some-thing'],
20
            ['silverstripe/silverstripe-silverstripe-thing', 'silverstripe-thing'],
21
            ['silverstripe-themes/silverstripe-theme', 'theme'],
22
            ['silverstripe-themes/silverstripe-hyphenated-theme', 'hyphenated-theme'],
23
        ];
24
    }
25
26
    /**
27
     * @dataProvider providePackageNamesAndTitles
28
     */
29
    public function testTitleFormatsNameCorrectly($name, $title)
30
    {
31
        $testPackage = Package::create([
32
            'Name' => $name
33
        ]);
34
        $this->assertEquals($title, $testPackage->getTitle());
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<BringYourOwnIdeas...ests\Model\PackageTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
35
    }
36
}
37