View = new View(null); $this->Form = new FormHelper($this->View); } /** * test novalidate for create * * @return void */ public function testCreate() { $expected = 'novalidate="novalidate"'; $result = $this->Form->create(); $this->assertStringNotContainsString($expected, $result); Configure::write('FormConfig.novalidate', true); $this->Form = new FormHelper($this->View); $result = $this->Form->create(); $this->assertStringContainsString($expected, $result); $result = $this->Form->create(null, ['novalidate' => false]); $this->assertStringNotContainsString($expected, $result); } }