Browse files

Added Travis support.

Bumped minimum CakePHP version to 2.1.3 as it fixes an issue with headers (headers_sent).
  • Loading branch information...
1 parent 77bfcff commit a2073c3dd6fe51a4f351c31ab7f4daa07dec5cd4 @renan renan committed Oct 26, 2012
Showing with 84 additions and 4 deletions.
  1. +79 −0 .travis.yml
  2. +2 −2 README.md
  3. +3 −2 Test/Case/Controller/Component/ToolbarComponentTest.php
View
79 .travis.yml
@@ -0,0 +1,79 @@
+language: php
+
+php:
+ - 5.3
+ - 5.4
+
+env:
+ - CAKE_VERSION=2.1.3 DB=mysql
+ - CAKE_VERSION=2.1.3 DB=pgsql
+ - CAKE_VERSION=master DB=mysql
+ - CAKE_VERSION=master DB=pgsql
+ - CAKE_VERSION=2.3 DB=mysql
+ - CAKE_VERSION=2.3 DB=pgsql
+
+before_script:
+ - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi"
+ - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi"
+ - git clone --depth 1 git://github.com/cakephp/cakephp ../cakephp && cd ../cakephp && git checkout $CAKE_VERSION
+ - cp -R ../debug_kit plugins/DebugKit
+ - chmod -R 777 ../cakephp/app/tmp
+ - set +H
+ - echo "<?php
+ class DATABASE_CONFIG {
+ private \$identities = array(
+ 'mysql' => array(
+ 'datasource' => 'Database/Mysql',
+ 'host' => '0.0.0.0',
+ 'login' => 'travis'
+ ),
+ 'pgsql' => array(
+ 'datasource' => 'Database/Postgres',
+ 'host' => '127.0.0.1',
+ 'login' => 'postgres',
+ 'database' => 'cakephp_test',
+ 'schema' => array(
+ 'default' => 'public',
+ 'test' => 'public'
+ )
+ )
+ );
+ public \$default = array(
+ 'persistent' => false,
+ 'host' => '',
+ 'login' => '',
+ 'password' => '',
+ 'database' => 'cakephp_test',
+ 'prefix' => ''
+ );
+ public \$test = array(
+ 'persistent' => false,
+ 'host' => '',
+ 'login' => '',
+ 'password' => '',
+ 'database' => 'cakephp_test',
+ 'prefix' => ''
+ );
+ public function __construct() {
+ \$db = 'mysql';
+ if (!empty(\$_SERVER['DB'])) {
+ \$db = \$_SERVER['DB'];
+ }
+ foreach (array('default', 'test') as \$source) {
+ \$config = array_merge(\$this->{\$source}, \$this->identities[\$db]);
+ if (is_array(\$config['database'])) {
+ \$config['database'] = \$config['database'][\$source];
+ }
+ if (!empty(\$config['schema']) && is_array(\$config['schema'])) {
+ \$config['schema'] = \$config['schema'][\$source];
+ }
+ \$this->{\$source} = \$config;
+ }
+ }
+ }" > ../cakephp/app/Config/database.php
+
+script:
+ - ./lib/Cake/Console/cake test DebugKit AllDebugKit --stderr
+
+notifications:
+ email: false
View
4 README.md
@@ -1,12 +1,12 @@
-# CakePHP DebugKit
+# CakePHP DebugKit [![Build Status](https://secure.travis-ci.org/cakephp/debug_kit.png?branch=master)](http://travis-ci.org/cakephp/debug_kit)
DebugKit provides a debugging toolbar and enhanced debugging tools for CakePHP applications.
## Requirements
The master branch has the following requirements:
-* CakePHP 2.1.0 or greater.
+* CakePHP 2.1.3 or greater.
* PHP 5.3.0 or greater.
## Installation
View
5 Test/Case/Controller/Component/ToolbarComponentTest.php
@@ -80,10 +80,11 @@ public function setUp() {
* @return void
*/
public function tearDown() {
- parent::tearDown();
-
$_SERVER = $this->_server;
$_GET = $this->_get;
+
+ parent::tearDown();
+
App::build(array(
'plugins' => $this->_paths['plugins'],
'views' => $this->_paths['views'],

0 comments on commit a2073c3

Please sign in to comment.