Completed
Push — master ( 96e397...a65e1b )
by Dennis
03:31
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 TildBJ\Seeder\Tests\Functional;
4
5
use TildBJ\Seeder\Generator\MethodNameGenerator;
6
7
/**
8
 * Class MethodNameGeneratorTest
9
 * This class tests the functionality between MethodNameGenerator and Faker
10
 *
11
 * @package TildBJ\Seeder\Tests\Functional
12
 */
13
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...
14
{
15
    /**
16
     * @var MethodNameGenerator $subject
17
     */
18
    protected $subject;
19
20
    public function setUp()
21
    {
22
        $faker = \TildBJ\Seeder\Factory\FakerFactory::createFaker();
23
        $this->subject = new MethodNameGenerator($faker);
24
    }
25
26
    /**
27
     * @method generate
28
     * @test
29
     */
30
    public function generateWithBodytextGeneratesGetTextAsMethodName()
31
    {
32
        $this->assertSame('$faker->getText()', $this->subject->generate('bodytext'));
33
    }
34
35
    /**
36
     * @method generate
37
     * @test
38
     */
39
    public function generateWithDescriptionGeneratesGetTextAsMethodName()
40
    {
41
        $this->assertSame('$faker->getText()', $this->subject->generate('description'));
42
    }
43
44
    /**
45
     * @method generate
46
     * @test
47
     */
48
    public function generateWithTstampGeneratesGetUnixtimeAsMethodName()
49
    {
50
        $this->assertSame('$faker->getUnixtime()', $this->subject->generate('tstamp'));
51
    }
52
}
53