Completed
Push — master ( b74cd0...088e4f )
by Dennis
11:47
created

MethodNameGeneratorTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 1
cbo 3
dl 0
loc 40
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 5 1
A generateWithBodytextGeneratesGetTextAsMethodName() 0 4 1
A generateWithDescriptionGeneratesGetTextAsMethodName() 0 4 1
A generateWithTstampGeneratesGetUnixtimeAsMethodName() 0 4 1
1
<?php
2
3
namespace Dennis\Seeder\Tests\Functional;
4
5
use Dennis\Seeder\Generator\MethodNameGenerator;
6
7
8
/**
9
 * Class MethodNameGeneratorTest
10
 * This class tests the functionality between MethodNameGenerator and Faker
11
 *
12
 * @package Dennis\Seeder\Tests\Functional
13
 */
14
class MethodNameGeneratorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
0 ignored issues
show
Deprecated Code introduced by
The class TYPO3\CMS\Core\Tests\UnitTestCase has been deprecated with message: will be removed once TYPO3 9 LTS is released

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
15
{
16
    /**
17
     * @var MethodNameGenerator $subject
18
     */
19
    protected $subject;
20
21
    public function setUp()
22
    {
23
        $faker = \Dennis\Seeder\Factory\FakerFactory::createFaker();
24
        $this->subject = new MethodNameGenerator($faker);
25
    }
26
27
    /**
28
     * @method generate
29
     * @test
30
     */
31
    public function generateWithBodytextGeneratesGetTextAsMethodName()
32
    {
33
        $this->assertSame('$faker->getText()', $this->subject->generate('bodytext'));
34
    }
35
36
    /**
37
     * @method generate
38
     * @test
39
     */
40
    public function generateWithDescriptionGeneratesGetTextAsMethodName()
41
    {
42
        $this->assertSame('$faker->getText()', $this->subject->generate('description'));
43
    }
44
45
    /**
46
     * @method generate
47
     * @test
48
     */
49
    public function generateWithTstampGeneratesGetUnixtimeAsMethodName()
50
    {
51
        $this->assertSame('$faker->getUnixtime()', $this->subject->generate('tstamp'));
52
    }
53
}
54