BookingFormTest::testFormElements()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 19
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 19
rs 9.4285
cc 1
eloc 13
nc 1
nop 0
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