Code Duplication    Length = 39-40 lines in 2 locations

src/HelloWordPl/SimpleEntityGeneratorBundle/Tests/Lib/Items/MethodSetterInterfaceManagerTest.php 1 location

@@ 13-52 (lines=40) @@
10
 *
11
 * @author SÅ‚awomir Kania <[email protected]>
12
 */
13
class MethodSetterInterfaceManagerTest extends BaseManager
14
{
15
16
    /**
17
     * @var MethodSetterManager
18
     */
19
    protected $methodSetterInterfaceManager = null;
20
21
    /**
22
     * SET UP
23
     */
24
    public function setUp()
25
    {
26
        parent::setUp();
27
28
        $this->methodSetterInterfaceManager = $this->preapareClassManager()->getInterface()->getMethods()->first();
29
    }
30
31
    public function testManger()
32
    {
33
        $this->assertInstanceOf('\HelloWordPl\SimpleEntityGeneratorBundle\Lib\Interfaces\RenderableInterface', $this->methodSetterInterfaceManager);
34
        $this->assertInstanceOf('\HelloWordPl\SimpleEntityGeneratorBundle\Lib\Interfaces\MethodInterface', $this->methodSetterInterfaceManager);
35
        $this->assertInstanceOf('\HelloWordPl\SimpleEntityGeneratorBundle\Lib\Interfaces\SetterMethodInterface', $this->methodSetterInterfaceManager);
36
        $this->assertInstanceOf('\HelloWordPl\SimpleEntityGeneratorBundle\Lib\Items\MethodManager', $this->methodSetterInterfaceManager);
37
        $this->assertInstanceOf('\HelloWordPl\SimpleEntityGeneratorBundle\Lib\Items\MethodSetterInterfaceManager', $this->methodSetterInterfaceManager);
38
        $this->assertEquals('setFullName', $this->methodSetterInterfaceManager->getPreparedName());
39
        $this->assertFalse($this->methodSetterInterfaceManager->canAddTypeHinting());
40
    }
41
42
    public function testCanAddTypeHinting()
43
    {
44
        $this->assertTrue($this->preapareClassManager()->getInterface()->getMethods()->get(7)->canAddTypeHinting());
45
    }
46
47
    public function testValidManagerWhenValid()
48
    {
49
        $errors = $this->getValidator()->validate($this->methodSetterInterfaceManager);
50
        $this->assertEquals(0, $errors->count());
51
    }
52
}
53

src/HelloWordPl/SimpleEntityGeneratorBundle/Tests/Lib/Items/MethodSetterManagerTest.php 1 location

@@ 13-51 (lines=39) @@
10
 *
11
 * @author SÅ‚awomir Kania <[email protected]>
12
 */
13
class MethodSetterManagerTest extends BaseManager
14
{
15
16
    /**
17
     * @var MethodSetterManager
18
     */
19
    protected $methodSetterManager = null;
20
21
    /**
22
     * SET UP
23
     */
24
    public function setUp()
25
    {
26
        parent::setUp();
27
        $this->methodSetterManager = $this->preapareClassManager()->getMethods()->first();
28
    }
29
30
    public function testManger()
31
    {
32
        $this->assertInstanceOf('\HelloWordPl\SimpleEntityGeneratorBundle\Lib\Interfaces\RenderableInterface', $this->methodSetterManager);
33
        $this->assertInstanceOf('\HelloWordPl\SimpleEntityGeneratorBundle\Lib\Interfaces\MethodInterface', $this->methodSetterManager);
34
        $this->assertInstanceOf('\HelloWordPl\SimpleEntityGeneratorBundle\Lib\Interfaces\SetterMethodInterface', $this->methodSetterManager);
35
        $this->assertInstanceOf('\HelloWordPl\SimpleEntityGeneratorBundle\Lib\Items\MethodManager', $this->methodSetterManager);
36
        $this->assertInstanceOf('\HelloWordPl\SimpleEntityGeneratorBundle\Lib\Items\MethodSetterManager', $this->methodSetterManager);
37
        $this->assertEquals('setFullName', $this->methodSetterManager->getPreparedName());
38
        $this->assertFalse($this->methodSetterManager->canAddTypeHinting());
39
    }
40
41
    public function testCanAddTypeHinting()
42
    {
43
        $this->assertTrue($this->preapareClassManager()->getMethods()->get(7)->canAddTypeHinting());
44
    }
45
46
    public function testValidManagerWhenValid()
47
    {
48
        $errors = $this->getValidator()->validate($this->methodSetterManager);
49
        $this->assertEquals(0, $errors->count());
50
    }
51
}
52