/** * @return void */ public function testPatchOptionalNotNull() { $this->skipIf(version_compare(Configure::version(), '3.3.7') <= 0); $data = ['string_optional_notnull' => '', 'active_optional_notnull' => '']; $entity = $this->Table->newEntity($data); $expected = ['string_optional_notnull' => '', 'active_optional_notnull' => false]; $this->assertSame($expected, $entity->toArray()); }
/** * @return void */ public function testFormInput() { $Form = new FormHelper(new View()); $entity = $this->Table->newEntity(); $Form->create($entity); $x = $Form->input('year_of_birth', ['type' => 'year']); $this->assertContains('<select name="year_of_birth[year]" type="year"', $x); // <div class="input number"><label for="year-of-birth">Year Of Birth</label><input type="number" name="year_of_birth" id="year-of-birth"/></div> }