From 6c7a4266410070d30f8f6bcdf9c9e67f3d6478e3 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 19 Jun 2017 11:33:58 +0300 Subject: [ci skip] 3.1.5 release --- tests/codeigniter/helpers/form_helper_test.php | 290 ------------------------- 1 file changed, 290 deletions(-) delete mode 100644 tests/codeigniter/helpers/form_helper_test.php (limited to 'tests/codeigniter/helpers/form_helper_test.php') diff --git a/tests/codeigniter/helpers/form_helper_test.php b/tests/codeigniter/helpers/form_helper_test.php deleted file mode 100644 index b5fe99b96..000000000 --- a/tests/codeigniter/helpers/form_helper_test.php +++ /dev/null @@ -1,290 +0,0 @@ -helper('form'); - } - - // ------------------------------------------------------------------------ - - public function test_form_hidden() - { - $expected = << - -EOH; - - $this->assertEquals($expected, form_hidden('username', 'johndoe')); - } - - // ------------------------------------------------------------------------ - - public function test_form_input() - { - $expected = << - -EOH; - - $data = array( - 'name' => 'username', - 'id' => 'username', - 'value' => 'johndoe', - 'maxlength' => '100', - 'size' => '50', - 'style' => 'width:50%', - ); - - $this->assertEquals($expected, form_input($data)); - } - - // ------------------------------------------------------------------------ - - public function test_form_password() - { - $expected = << - -EOH; - - $this->assertEquals($expected, form_password('password')); - } - - // ------------------------------------------------------------------------ - - public function test_form_upload() - { - $expected = << - -EOH; - - $this->assertEquals($expected, form_upload('attachment')); - } - - // ------------------------------------------------------------------------ - - public function test_form_textarea() - { - $expected = <<Notes - -EOH; - - $this->assertEquals($expected, form_textarea('notes', 'Notes')); - } - - // ------------------------------------------------------------------------ - - public function test_form_dropdown() - { - $expected = << - - - - - - -EOH; - - $options = array( - 'small' => 'Small Shirt', - 'med' => 'Medium Shirt', - 'large' => 'Large Shirt', - 'xlarge' => 'Extra Large Shirt', - ); - - $this->assertEquals($expected, form_dropdown('shirts', $options, 'large')); - - $expected = << - - - - - - -EOH; - - $shirts_on_sale = array('small', 'large'); - - $this->assertEquals($expected, form_dropdown('shirts', $options, $shirts_on_sale)); - - $options = array( - 'Swedish Cars' => array( - 'volvo' => 'Volvo', - 'saab' => 'Saab' - ), - 'German Cars' => array( - 'mercedes' => 'Mercedes', - 'audi' => 'Audi' - ) - ); - - $expected = << - - - - - - - - - - -EOH; - - $this->assertEquals($expected, form_dropdown('cars', $options, array('volvo', 'audi'))); - } - - // ------------------------------------------------------------------------ - - public function test_form_multiselect() - { - $expected = << - - - - - - -EOH; - - $options = array( - 'small' => 'Small Shirt', - 'med' => 'Medium Shirt', - 'large' => 'Large Shirt', - 'xlarge' => 'Extra Large Shirt', - ); - - $this->assertEquals($expected, form_multiselect('shirts[]', $options, array('med', 'large'))); - } - - // ------------------------------------------------------------------------ - - public function test_form_fieldset() - { - $expected = << -Address Information - -EOH; - - $this->assertEquals($expected, form_fieldset('Address Information')); - } - - // ------------------------------------------------------------------------ - - public function test_form_fieldset_close() - { - $expected = << -EOH; - - $this->assertEquals($expected, form_fieldset_close('')); - } - - // ------------------------------------------------------------------------ - - public function test_form_checkbox() - { - $expected = << - -EOH; - - $this->assertEquals($expected, form_checkbox('newsletter', 'accept', TRUE)); - } - - // ------------------------------------------------------------------------ - - public function test_form_radio() - { - $expected = << - -EOH; - - $this->assertEquals($expected, form_radio('newsletter', 'accept', TRUE)); - } - - // ------------------------------------------------------------------------ - - public function test_form_submit() - { - $expected = << - -EOH; - - $this->assertEquals($expected, form_submit('mysubmit', 'Submit Post!')); - } - - // ------------------------------------------------------------------------ - - public function test_form_label() - { - $expected = <<What is your Name -EOH; - - $this->assertEquals($expected, form_label('What is your Name', 'username')); - } - - // ------------------------------------------------------------------------ - - public function test_form_reset() - { - $expected = << - -EOH; - - $this->assertEquals($expected, form_reset('myreset', 'Reset')); - } - - // ------------------------------------------------------------------------ - - public function test_form_button() - { - $expected = <<content - -EOH; - - $this->assertEquals($expected, form_button('name', 'content')); - } - - // ------------------------------------------------------------------------ - - public function test_form_close() - { - $expected = << -EOH; - - $this->assertEquals($expected, form_close('')); - } - - // ------------------------------------------------------------------------ - - public function test_form_prep() - { - $this->assertEquals( - 'Here is a string containing "quoted" text.', - form_prep('Here is a string containing "quoted" text.') - ); - - $this->assertEquals( - 'Here is a string containing a <tag>.', - form_prep('Here is a string containing a .', TRUE) - ); - } - -} -- cgit v1.2.3-24-g4f1b