Skip to content

Commit

Permalink
Fixes all tests to pass on most machines
Browse files Browse the repository at this point in the history
Everyone who runs the "make test" may have different default Yaf`s INI
settings.

* in case the yaf.use_namespace=1 almost all tests fails
* in case the yaf.environ=dev around 5 tests fails
* in case the yaf.use_spl_autoload=1 one test fails

This fix specifies necessary INI values to pass all the tests.
  • Loading branch information
fruit committed Apr 23, 2013
1 parent 99472cd commit ff76d68
Show file tree
Hide file tree
Showing 71 changed files with 107 additions and 2 deletions.
2 changes: 2 additions & 0 deletions tests/002.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Check for Yaf_Request_Simple
--SKIPIF--
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.use_namespace=0
--FILE--
<?php
$request = new Yaf_Request_Simple("CLI", "index", "dummy", NULL, array());
Expand Down
1 change: 1 addition & 0 deletions tests/003.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Check for Yaf_Loader
--INI--
yaf.use_spl_autoload=0
yaf.lowcase_path=0
yaf.use_namespace=0
--FILE--
<?php
ini_set("ap.lowcase_path", FALSE);
Expand Down
2 changes: 2 additions & 0 deletions tests/004.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Check for Yaf_Registry
--SKIPIF--
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.use_namespace=0
--FILE--
<?php
$str = "Ageli Platform";
Expand Down
2 changes: 2 additions & 0 deletions tests/005.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Check for Yaf_Response
--SKIPIF--
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.use_namespace=0
--FILE--
<?php
$response = new Yaf_Response_Http();
Expand Down
2 changes: 2 additions & 0 deletions tests/006.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Check for Yaf_Route_Static
--SKIPIF--
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.use_namespace=0
--FILE--
<?php
$request_uri = "/prefix/controller/action/name/laruence/age/28";
Expand Down
2 changes: 2 additions & 0 deletions tests/007.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Check for Yaf_Config_Simple
--SKIPIF--
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.use_namespace=0
--FILE--
<?php
$config = array(
Expand Down
2 changes: 2 additions & 0 deletions tests/008.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Check for Yaf_Router
--SKIPIF--
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.use_namespace=0
--FILE--
<?php

Expand Down
2 changes: 2 additions & 0 deletions tests/009.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Check for Yaf_View_Simple
--SKIPIF--
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.use_namespace=0
--FILE--
<?php
$view = new Yaf_View_Simple(dirname(__FILE__));
Expand Down
2 changes: 2 additions & 0 deletions tests/010.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Check for Yaf_Config_Ini
--SKIPIF--
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.use_namespace=0
--FILE--
<?php
$file = dirname(__FILE__) . "/simple.ini";
Expand Down
2 changes: 2 additions & 0 deletions tests/011.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Check for Yaf_Route_Rewrite
--SKIPIF--
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.use_namespace=0
--FILE--
<?php
$request = new Yaf_Request_Http("/subdir/ap/1.2/name/value", "/subdir");
Expand Down
2 changes: 2 additions & 0 deletions tests/012.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Check for Yaf_Route_Regex
--SKIPIF--
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.use_namespace=0
--FILE--
<?php
$request = new Yaf_Request_Http("/subdir/ap/1.2/name/value", "/subdir");
Expand Down
2 changes: 2 additions & 0 deletions tests/013.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Check for Yaf_Router and Config Routes
--SKIPIF--
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.use_namespace=0
--FILE--
<?php
$file = dirname(__FILE__) . "/simple.ini";
Expand Down
3 changes: 2 additions & 1 deletion tests/014.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ Check for Yaf_Application
--SKIPIF--
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.environ=product
yaf.environ="product"
yaf.use_namespace=0
--FILE--
<?php
define("APPLICATION_PATH", dirname(__FILE__));
Expand Down
2 changes: 2 additions & 0 deletions tests/015.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Check for Yaf_Exception
--SKIPIF--
<?php if (!extension_loaded("yaf")) print "skip"; ?>
<?php if (version_compare(PHP_VERSION, "5.3.0", "lt")) print "skip"; ?>
--INI--
yaf.use_namespace=0
--FILE--
<?php
$previous = new Yaf_Exception("Previous", 100);
Expand Down
2 changes: 2 additions & 0 deletions tests/016.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Check for Yaf_Session
--SKIPIF--
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.use_namespace=0
--FILE--
<?php
$session = Yaf_Session::getInstance();
Expand Down
2 changes: 2 additions & 0 deletions tests/017.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Bug (mem leak and crash in Yaf_Config_Ini)
--SKIPIF--
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.use_namespace=0
--FILE--
<?php
$config = new Yaf_Config_Ini;
Expand Down
2 changes: 2 additions & 0 deletions tests/018.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Bug Yaf_Config_Ini crash due to inaccurate refcount
--SKIPIF--
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.use_namespace=0
--FILE--
<?php
$file = dirname(__FILE__) . "/simple.ini";
Expand Down
2 changes: 2 additions & 0 deletions tests/019.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Yaf_Router::getCurrent with number key
--SKIPIF--
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.use_namespace=0
--FILE--
<?php
$request = new Yaf_Request_Http("/subdir/ap/1.2/name/value", "/subdir");
Expand Down
1 change: 1 addition & 0 deletions tests/020.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Check for Yaf_Application
--SKIPIF--
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.use_namespace=0
--FILE--
<?php
$config = array(
Expand Down
1 change: 1 addition & 0 deletions tests/021.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Check for Yaf_Application
--SKIPIF--
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.use_namespace=0
--FILE--
<?php
define("APPLICATION_PATH", dirname(__FILE__));
Expand Down
1 change: 1 addition & 0 deletions tests/022.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Check for Yaf_Application
--SKIPIF--
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.use_namespace=0
--FILE--
<?php
$config = array(
Expand Down
1 change: 1 addition & 0 deletions tests/023.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Check for Yaf_Loader::set/get(library_path)
--INI--
yaf.use_spl_autoload=0
yaf.lowcase_path=0
yaf.use_namespace=0
--FILE--
<?php
$loader = Yaf_Loader::getInstance('/foo', '/bar');
Expand Down
1 change: 1 addition & 0 deletions tests/024.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Check for Yaf_Loader::getInstace() paramters
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.library="/php/global/dir"
yaf.use_namespace=0
--FILE--
<?php
$loader = Yaf_Loader::getInstance('/foo', '/bar');
Expand Down
1 change: 1 addition & 0 deletions tests/025.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Check for Yaf_Loader with namespace configuration
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.library="/php/global/dir"
yaf.use_namespace=0
--FILE--
<?php
$config = array(
Expand Down
1 change: 1 addition & 0 deletions tests/026.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Check for Yaf_Response::setBody/prependBody/appendBody
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.library="/php/global/dir"
yaf.use_namespace=0
--FILE--
<?php
$response = new Yaf_Response_Http();
Expand Down
3 changes: 2 additions & 1 deletion tests/027.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Check for Yaf autoload controller
--INI--
yaf.use_spl_autoload=0
yaf.library="/php/global/dir"
yar.environ="product"
yaf.environ="product"
yaf.use_namespace=0
--FILE--
<?php
$config = array(
Expand Down
1 change: 1 addition & 0 deletions tests/028.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Bug segfault while call exit in a view template
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.library="/php/global/dir"
yaf.use_namespace=0
--FILE--
<?php
require "build.inc";
Expand Down
1 change: 1 addition & 0 deletions tests/029.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Check for Yaf_View_Simple::get and clear
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.library="/php/global/dir"
yaf.use_namespace=0
--FILE--
<?php
$view = new Yaf_View_Simple(dirname(__FILE__));
Expand Down
1 change: 1 addition & 0 deletions tests/030.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Check for Yaf_Config_Ini::__construct with section
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.library="/php/global/dir"
yaf.use_namespace=0
--FILE--
<?php
$file = dirname(__FILE__) . "/simple.ini";
Expand Down
1 change: 1 addition & 0 deletions tests/031.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Check for application.dispatcher.defaultRoute
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.library="/php/global/dir"
yaf.use_namespace=0
--FILE--
<?php
$config = array(
Expand Down
1 change: 1 addition & 0 deletions tests/032.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {
?>
--INI--
yaf.directory=/foo/bar
yaf.use_namespace=0
--FILE--
<?php
putenv("FOO=bar");
Expand Down
2 changes: 2 additions & 0 deletions tests/033.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Check for Yaf_View_Simple with predefined template dir
--SKIPIF--
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.use_namespace=0
--FILE--
<?php
$config = array(
Expand Down
2 changes: 2 additions & 0 deletions tests/034.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip windows has a different absolute path');
}
?>
--INI--
yaf.use_namespace=0
--FILE--
<?php
$view = new Yaf_View_Simple("/tmp");
Expand Down
1 change: 1 addition & 0 deletions tests/035.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ if (version_compare(PHP_VERSION, '5.4.0') >= 0) {
?>
--INI--
short_open_tag = 0
yaf.use_namespace=0
--FILE--
<?php
$view = new Yaf_View_Simple(dirname(__FILE__));
Expand Down
1 change: 1 addition & 0 deletions tests/036.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Check for Yaf_Route_Static with arbitrary urls
--SKIPIF--
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.use_namespace=0
--FILE--
<?php
$url = array(
Expand Down
2 changes: 2 additions & 0 deletions tests/037.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ if (version_compare(PHP_VERSION, "5.3", "lt")) {
?>
--INI--
yaf.lowcase_path=0
yaf.use_spl_autoload=0
yaf.use_namespace=0
--FILE--
<?php
$dir = __DIR__;
Expand Down
1 change: 1 addition & 0 deletions tests/038.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Check for Yaf_View_Simple error message outputing
yaf.library="/php/global/dir"
log_errors=0
display_errors=1
yaf.use_namespace=0
--FILE--
<?php
require "build.inc";
Expand Down
1 change: 1 addition & 0 deletions tests/039.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Check for Yaf_View_Simple recursive render error message outputing
yaf.library="/php/global/dir"
log_errors=0
display_errors=1
yaf.use_namespace=0
--FILE--
<?php
require "build.inc";
Expand Down
1 change: 1 addition & 0 deletions tests/040.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Fixed bug that segv in Yaf_View_Simple::render if the tpl is not a string
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.library="/php/global/dir"
yaf.use_namespace=0
--FILE--
<?php
$view = new Yaf_View_Simple(dirname(__FILE__));
Expand Down
2 changes: 2 additions & 0 deletions tests/041.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Check for controller return false preventing auto-renderring
--SKIPIF--
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.use_namespace=0
--FILE--
<?php
$config = array(
Expand Down
2 changes: 2 additions & 0 deletions tests/042.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Check for throw exception in Yaf_Controller::init
--SKIPIF--
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.use_namespace=0
--FILE--
<?php
$config = array(
Expand Down
2 changes: 2 additions & 0 deletions tests/043.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ yaf.cache_config=0
yaf.name_suffix=1
yaf.name_separator=""
yaf.lowcase_path=1
yaf.environ="product"
yaf.use_namespace=0
--FILE--
<?php
define("APPLICATION_PATH", dirname(__FILE__));
Expand Down
2 changes: 2 additions & 0 deletions tests/044.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Memleaks in Yaf_Dispatcher::getInstance()
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.use_namespace=0
yaf.environ="product"
yaf.use_namespace=0
--FILE--
<?php
define("APPLICATION_PATH", dirname(__FILE__));
Expand Down
2 changes: 2 additions & 0 deletions tests/045.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Check for segfault while use closure as error handler
if (!extension_loaded("yaf")) print "skip";
if (!version_compare(PHP_VERSION, "5.3", "ge")) print "skip only for 5.3+";
?>
--INI--
yaf.use_namespace=0
--FILE--
<?php
$config = array(
Expand Down
1 change: 1 addition & 0 deletions tests/046.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Check for Yaf_Loader with single class
--INI--
yaf.use_spl_autoload=0
yaf.lowcase_path=0
yaf.use_namespace=0
--FILE--
<?php
$config = array(
Expand Down
1 change: 1 addition & 0 deletions tests/047.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Check for Yaf_Loader with spl_autoload
--INI--
yaf.use_spl_autoload=0
yaf.lowcase_path=0
yaf.use_namespace=0
--FILE--
<?php
$config = array(
Expand Down
Loading

0 comments on commit ff76d68

Please sign in to comment.