Completed
Push — master ( bd2863...897b5a )
by Shcherbak
45:04 queued 30:10
created

InTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testIn() 0 20 1
1
<?php
2
3
  namespace Tests\Fiv\Form\Validator;
4
5
  use Fiv\Form\Form;
6
7
  /**
8
   *
9
   */
10
  class InTest extends \PHPUnit_Framework_TestCase {
11
12
13
    public function testIn() {
14
      $inValidator = new \Fiv\Form\Validator\In();
15
      $inValidator->setValues(['a', 'b', 'c']);
16
17
      $form = new Form();
18
      $form->input('inputName')
19
        ->addValidator($inValidator);
20
21
      $form->setData([
22
        $form->getUid() => 1,
23
        'inputName' => 'a',
24
      ]);
25
      $this->assertTrue($form->isValid());
26
27
      $form->setData([
28
        $form->getUid() => 1,
29
        'inputName' => 'd',
30
      ]);
31
      $this->assertFalse($form->isValid());
32
    }
33
34
  }
35