@@ 40-55 (lines=16) @@ | ||
37 | ||
38 | class GeolocationTest extends TestCase |
|
39 | { |
|
40 | public function testProvidesDefaultValidators() |
|
41 | { |
|
42 | $element = new Geolocation('foo'); |
|
43 | ||
44 | $inputSpec = $element->getInputSpecification(); |
|
45 | ||
46 | $this->assertArrayHasKey('validators', $inputSpec); |
|
47 | $this->assertInternalType('array', $inputSpec['validators']); |
|
48 | ||
49 | $expectedClasses = array(IsGeolocation::class); |
|
50 | ||
51 | foreach ($inputSpec['validators'] as $validator) { |
|
52 | $class = get_class($validator); |
|
53 | $this->assertTrue(in_array($class, $expectedClasses), $class); |
|
54 | } |
|
55 | } |
|
56 | ||
57 | public function testProvidesDefaultFilters() |
|
58 | { |
|
@@ 57-75 (lines=19) @@ | ||
54 | } |
|
55 | } |
|
56 | ||
57 | public function testProvidesDefaultFilters() |
|
58 | { |
|
59 | $element = new Geolocation('foo'); |
|
60 | ||
61 | $inputSpec = $element->getInputSpecification(); |
|
62 | ||
63 | $this->assertArrayHasKey('filters', $inputSpec); |
|
64 | $this->assertInternalType('array', $inputSpec['filters']); |
|
65 | ||
66 | $expectedClasses = array( |
|
67 | StringTrim::class, |
|
68 | \Org_Heigl\Geolocation\Filter\Geolocation::class, |
|
69 | ); |
|
70 | ||
71 | foreach ($inputSpec['filters'] as $filter) { |
|
72 | $class = get_class($filter); |
|
73 | $this->assertTrue(in_array($class, $expectedClasses), $class); |
|
74 | } |
|
75 | } |
|
76 | ||
77 | public function testSetName() |
|
78 | { |