Skip to content
Browse files

fix to #8

  • Loading branch information...
1 parent e4b70c0 commit d219a0197299a851740efc19e706321ab542ba83 @DavertMik DavertMik committed Feb 28, 2012
View
19 codecept.bat
@@ -1,8 +1,11 @@
-@echo off
-if "%PHPBIN%" == "" set PHPBIN=@php_bin@
-if not exist "%PHPBIN%" if "%PHP_PEAR_PHP_BIN%" neq "" goto USE_PEAR_PATH
-GOTO RUN
-:USE_PEAR_PATH
-set PHPBIN=%PHP_PEAR_PHP_BIN%
-:RUN
-"%PHPBIN%" "@bin_dir@\codecept" %*
+@echo off
+if "%PHPBIN%" == "" set PHPBIN=@php_bin@
+if exist "codecept" goto INTERNAL
+if not exist "%PHPBIN%" if "%PHP_PEAR_PHP_BIN%" neq "" goto USE_PEAR_PATH
+GOTO RUN
+:USE_PEAR_PATH
+set PHPBIN=%PHP_PEAR_PHP_BIN%
+:RUN
+"%PHPBIN%" "@bin_dir@\codecept" %*
+:INTERNAL
+"%PHPBIN%" "codecept" %*
View
1 src/Codeception/Module/ZF1.php
@@ -119,6 +119,7 @@ protected function debugResponse()
// $this->client->getzendrequest()->getcontrollername(),
// $this->client->getzendrequest()->getactionname()
// ));
+ $this->debugSection('Session',json_encode($_COOKIE));
if ($this->db) {
$profiler = $this->db->getProfiler();
$queries = $profiler->getTotalNumQueries() - $this->queries;
View
5 src/Codeception/Util/Framework.php
@@ -194,7 +194,10 @@ protected function getFormFor($node)
$action = $this->getFormUrl($form);
if (!isset($this->forms[$action])) {
- $form->children()->addHtmlContent('<input type="submit" />'); // for forms with no submits...
+ $submit = new \DOMElement('input');
+ $submit = $form->current()->appendChild($submit);
+ $submit->setAttribute('type','submit'); // for forms with no submits
+
$form = $form->filter('input[type=submit]')->form();
$this->forms[$action] = $form;
}
View
2 tests/data/app/db
@@ -1 +1 @@
-a:1:{s:13:"4f4356d6a9057";a:0:{}}
+a:0:{}
View
2 tests/data/app/index.php
@@ -10,7 +10,7 @@
'/' => 'index',
'/info' => 'info',
'/login' => 'login',
- '/form/(field|select|checkbox|file|textarea|hidden|complex)(#)?' => 'form'
+ '/form/(field|select|checkbox|file|textarea|hidden|complex|button|empty)(#)?' => 'form'
);
glue::stick($urls);
View
8 tests/data/app/view/form/button.php
@@ -0,0 +1,8 @@
+<html>
+<body>
+<form action="/form/button" method="POST">
+ <input type="hidden" name="text" value="val" />
+ <button type="submit">Submit</button>
+</form>
+</body>
+</html>
View
7 tests/data/app/view/form/empty.php
@@ -0,0 +1,7 @@
+<html>
+<body>
+<form action="/form/empty" method="POST">
+ <input type="text" name="text" value="val">
+</form>
+</body>
+</html>
View
20 tests/log/codeception-2012-02-06.log
@@ -1,20 +0,0 @@
-[2012-02-06 01:25:07] Codeception.ALERT: Failed asserting that two strings are equal. [] []
-[2012-02-06 01:25:07] Codeception.INFO: # FAILED # [] []
-[2012-02-06 01:25:07] Codeception.INFO: PASSED [] []
-[2012-02-06 01:27:04] Codeception.ALERT: Undefined offset: 0 [] []
-[2012-02-06 01:27:04] Codeception.INFO: # ERROR # [] []
-[2012-02-06 01:27:04] Codeception.INFO: PASSED [] []
-[2012-02-06 01:29:15] Codeception.ALERT: Undefined offset: 1 [] []
-[2012-02-06 01:29:15] Codeception.INFO: # ERROR # [] []
-[2012-02-06 01:29:15] Codeception.INFO: PASSED [] []
-[2012-02-06 01:30:54] Codeception.INFO: PASSED [] []
-[2012-02-06 22:38:14] Codeception.ALERT: Failed asserting that two strings are equal. [] []
-[2012-02-06 22:38:14] Codeception.INFO: # FAILED # [] []
-[2012-02-06 22:38:14] Codeception.INFO: PASSED [] []
-[2012-02-06 22:41:00] Codeception.ALERT: preg_match() expects parameter 2 to be string, array given [] []
-[2012-02-06 22:41:00] Codeception.INFO: # ERROR # [] []
-[2012-02-06 22:41:00] Codeception.INFO: PASSED [] []
-[2012-02-06 22:41:22] Codeception.ALERT: Failed asserting that two strings are equal. [] []
-[2012-02-06 22:41:22] Codeception.INFO: # FAILED # [] []
-[2012-02-06 22:41:22] Codeception.INFO: PASSED [] []
-[2012-02-06 22:45:46] Codeception.INFO: PASSED [] []
View
16 tests/unit/Codeception/Module/FrameworksTest.php
@@ -169,6 +169,20 @@ public function testSubmitForm() {
$this->assertEquals('Davert', $form['name']);
$this->assertEquals('kill_all', $form['action']);
}
+
+ public function testSubmitFormWithNoSubmitButton() {
+ $this->module->amOnPage('/form/empty');
+ $this->module->submitForm('form', array('text' => 'davert'));
+ $form = data::get('form');
+ $this->assertEquals('davert', $form['text']);
+ }
+
+ public function testSubmitFormByButton() {
+ $this->module->amOnPage('/form/button');
+ $this->module->click('Submit');
+ $form = data::get('form');
+ $this->assertEquals('val', $form['text']);
+ }
public function testAjax() {
$this->module->sendAjaxGetRequest('/info', array('show' => 'author'));
@@ -213,5 +227,7 @@ public function testComplexSelectorsAndForms() {
$this->assertEquals('miles@davis.com', $post['email']);
}
+
+
}

0 comments on commit d219a01

Please sign in to comment.
Something went wrong with that request. Please try again.