|
@@ 48-68 (lines=21) @@
|
| 45 |
|
$this->assertEquals(1, $crawler->filter('input#form_date_example3')->count()); |
| 46 |
|
} |
| 47 |
|
|
| 48 |
|
public function testIfSingleTextWithDatePickerAndDefaultDateRenderedCorrectly() |
| 49 |
|
{ |
| 50 |
|
$crawler = $this->getCrawlerForRequest('GET', '/_tests/datepicker'); |
| 51 |
|
|
| 52 |
|
$element = $crawler->filter('input#form_date_example4'); |
| 53 |
|
$wrapper = $element->parents()->filter('.date-widget')->first(); |
| 54 |
|
|
| 55 |
|
$this->assertEquals(1, $element->count()); |
| 56 |
|
$this->assertEquals(1, $wrapper->count()); |
| 57 |
|
|
| 58 |
|
// check if it has all the required data-attributes |
| 59 |
|
$this->assertEquals('datepicker', $wrapper->attr('data-provider')); |
| 60 |
|
$this->assertEquals('1985-06-20', $wrapper->attr('data-date')); |
| 61 |
|
$this->assertEquals('form_date_example4', $wrapper->attr('data-link-field')); |
| 62 |
|
$this->assertEquals('yyyy-mm-dd', $wrapper->attr('data-link-format')); |
| 63 |
|
$this->assertEquals('normal', $wrapper->attr('data-date-type')); |
| 64 |
|
|
| 65 |
|
// check if the actual element is hidden |
| 66 |
|
$this->assertEquals('hidden', $element->attr('type')); |
| 67 |
|
$this->assertEquals('1985-06-20', $element->attr('value')); |
| 68 |
|
} |
| 69 |
|
|
| 70 |
|
public function testIfSingleTextWithDatePickerRenderedCorrectly() |
| 71 |
|
{ |
|
@@ 170-190 (lines=21) @@
|
| 167 |
|
$this->assertEquals($date->format('Y-m-d'), $element->attr('value')); |
| 168 |
|
} |
| 169 |
|
|
| 170 |
|
public function testIfSingleTextWithoutDefaultDateRenderedCorrectly() |
| 171 |
|
{ |
| 172 |
|
$crawler = $this->getCrawlerForRequest('GET', '/_tests/datepicker'); |
| 173 |
|
|
| 174 |
|
$element = $crawler->filter('input#form_date_example9'); |
| 175 |
|
$wrapper = $element->parents()->filter('.date-widget')->first(); |
| 176 |
|
|
| 177 |
|
$this->assertEquals(1, $element->count()); |
| 178 |
|
$this->assertEquals(1, $wrapper->count()); |
| 179 |
|
|
| 180 |
|
// check if it has all the required data-attributes |
| 181 |
|
$this->assertEquals('datepicker', $wrapper->attr('data-provider')); |
| 182 |
|
$this->assertEquals('', $wrapper->attr('data-date')); |
| 183 |
|
$this->assertEquals('form_date_example9', $wrapper->attr('data-link-field')); |
| 184 |
|
$this->assertEquals('yyyy-mm-dd', $wrapper->attr('data-link-format')); |
| 185 |
|
$this->assertEquals('normal', $wrapper->attr('data-date-type')); |
| 186 |
|
|
| 187 |
|
// check if the actual element is hidden |
| 188 |
|
$this->assertEquals('hidden', $element->attr('type')); |
| 189 |
|
$this->assertEquals('', $element->attr('value')); |
| 190 |
|
} |
| 191 |
|
} |
| 192 |
|
|