/** * testCaptcha * * @param array $expect * * @dataProvider providerCaptcha * * @since 2.6.0 */ public function testCaptcha($expect = array()) { /* setup */ $form = new Html\Form($this->_registry, $this->_language); $form->init(); $form->captcha($expect['type']); /* actual */ $actual = $form->render(); /* compare */ $this->assertStringStartsWith($expect['prefix'], $actual); $this->assertStringEndsWith($expect['suffix'], $actual); }
/** * testCaptcha * * @since 3.0.0 * * @param array $expectArray * * @dataProvider providerCaptcha */ public function testCaptcha($expectArray = []) { /* setup */ $form = new Html\Form($this->_registry, $this->_language); $form->init(null, ['captcha' => true]); $form->captcha($expectArray['type']); /* actual */ $actual = $form->render(); /* compare */ $this->assertStringStartsWith($expectArray['start'], $actual); $this->assertStringEndsWith($expectArray['end'], $actual); }