BookingFormTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 1
cbo 3
dl 0
loc 25
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testFormElements() 0 19 1
1
<?php
2
3
namespace JhFlexiTimeTest\Form;
4
5
use JhFlexiTime\Form\BookingForm;
6
7
/**
8
 * Class BookingFormTest
9
 * @package JhFlexiTimeTest\Form
10
 * @author Aydin Hassan <[email protected]>
11
 */
12
class BookingFormTest extends \PHPUnit_Framework_TestCase
13
{
14
    /**
15
     * Test Form Elements
16
     */
17
    public function testFormElements()
18
    {
19
        $objectManager  = $this->getMock('Doctrine\Common\Persistence\ObjectManager');
20
        $user           = $this->getMock('ZfcUser\Entity\UserInterface');
21
        $fieldset = $this->getMockBuilder('\JhFlexiTime\Form\Fieldset\BookingFieldset')
22
            ->setMethods(['__construct', 'getName'])
23
            ->setConstructorArgs([$objectManager, $user])
24
            ->getMock();
25
26
        $fieldset->expects($this->once())
27
                 ->method('getName')
28
                 ->will($this->returnValue('time'));
29
30
31
        $form = new BookingForm($objectManager, $fieldset);
32
33
        $this->assertTrue($form->has("time"));
34
        $this->assertTrue($form->has("submit"));
35
    }
36
}
37