Skip to content

Commit

Permalink
Fixed misleading error message when providing a string in Yaf_Applica…
Browse files Browse the repository at this point in the history
…tion construction

see laruence#55
  • Loading branch information
elad-yosifon committed Sep 13, 2013
1 parent 2c11a50 commit c88dfa9
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions package2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
<file name="067.phpt" role="test" />
<file name="068.phpt" role="test" />
<file name="069.phpt" role="test" />
<file name="070.phpt" role="test" />
<file name="build.inc" role="test" />
<file name="bug61493.phpt" role="test" />
<file name="bug63381.phpt" role="test" />
Expand Down
26 changes: 26 additions & 0 deletions tests/070.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
--TEST--
Fixed misleading error message when providing a string in Yaf_Application construction
--SKIPIF--
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
--FILE--
<?php

$config = <<<'INI'
[product]
;CONSTANTS is supported
application.directory = APP_PATH "/application/"
INI;

try {
$app = new Yaf_Application($config);
$app->run();
}
catch (Exception $e){
print $e->getPrevious()->getMessage();
}

?>
--CLEAN--
--EXPECTF--
Expects a path to *.ini configuration file as parameter
2 changes: 2 additions & 0 deletions yaf_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,8 @@ yaf_config_t * yaf_config_instance(yaf_config_t *this_ptr, zval *arg1, zval *arg

return instance;
}
yaf_trigger_error(YAF_ERR_TYPE_ERROR TSRMLS_CC, "Expects a path to *.ini configuration file as parameter");
return NULL;
}

if (Z_TYPE_P(arg1) == IS_ARRAY) {
Expand Down

0 comments on commit c88dfa9

Please sign in to comment.