diff --git a/.travis.yml b/.travis.yml index 3e9aa3b7..fbfb2d8c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,28 +3,17 @@ language: php # list any PHP version you want to test against php: - # using major version aliases - - # aliased to 5.2.17 - - 5.2 - # aliased to 5.3.29 - - 5.3 - # aliased to a recent 5.4.x version - - 5.4 - # aliased to a recent 5.5.x version - - 5.5 - # aliased to a recent 5.6.x version - - 5.6 - # aliased to a recent 7.x version - - 7.0 - # aliased to a recent hhvm version - - hhvm + - '7.0' + - hhvm # on Trusty only + - nightly + # optionally specify a list of environments, for example to test different RDBMS env: - DB=mysql - DB=pgsql + # optionally set up exclusions and allowed failures in the matrix matrix: exclude: @@ -36,14 +25,14 @@ matrix: # execute any number of scripts before the test run, custom env's are available as variables before_script: - - if [[ "$DB" == "pgsql" ]]; then psql -c "DROP DATABASE IF EXISTS hello_world_test;" -U postgres; fi - - if [[ "$DB" == "pgsql" ]]; then psql -c "create database hello_world_test;" -U postgres; fi - - if [[ "$DB" == "mysql" ]]; then mysql -e "create database IF NOT EXISTS hello_world_test;" -uroot; fi + # - if [[ "$DB" == "pgsql" ]]; then psql -c "DROP DATABASE IF EXISTS hello_world_test;" -U postgres; fi + # - if [[ "$DB" == "pgsql" ]]; then psql -c "create database hello_world_test;" -U postgres; fi +# - if [[ "$DB" == "mysql" ]]; then mysql -e "create database IF NOT EXISTS hello_world_test;" -uroot; fi # omitting "script:" will default to phpunit # use the $DB env variable to determine the phpunit.xml to use -script: phpunit --configuration phpunit_$DB.xml --coverage-text +# script: phpunit --configuration phpunit_$DB.xml --coverage-text # configure notifications (email, IRC, campfire etc) notifications: - irc: "irc.freenode.org#yourfavouriteroomfortravis" + # irc: "irc.freenode.org#yourfavouriteroomfortravis" diff --git a/README.md b/README.md index a3515555..95946290 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,8 @@ continuous integration with a PHP project. Here is a sample status icon showing the state of the master branch. -[![Build Status](https://travis-ci.org/travis-ci-examples/php.svg?branch=master)](https://travis-ci.org/travis-ci-examples/php) +[![Build Status](https://app.travis-ci.com/madrizcarlose/php-example.svg?branch=master)](https://travis-ci.org/travis-ci-examples/php) + In order to run this project just fork it on github.com and then [enable](http://about.travis-ci.org/docs/user/getting-started/) your fork on your [travis-ci profile](http://travis-ci.org/profile). Every push will then trigger a new build on Travis CI. diff --git a/Tests/HelloWorldTest.php b/Tests/HelloWorldTest.php index eaab7996..bae5ac89 100644 --- a/Tests/HelloWorldTest.php +++ b/Tests/HelloWorldTest.php @@ -1,47 +1,4 @@ pdo = new PDO($GLOBALS['db_dsn'], $GLOBALS['db_username'], $GLOBALS['db_password']); - $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - $this->pdo->query("CREATE TABLE hello (what VARCHAR(50) NOT NULL)"); - } - - public function tearDown() - { - $this->pdo->query("DROP TABLE hello"); - } - - public function testHelloWorld() - { - $helloWorld = new HelloWorld($this->pdo); - - $this->assertEquals('Hello World', $helloWorld->hello()); - } - - public function testHello() - { - $helloWorld = new HelloWorld($this->pdo); - - $this->assertEquals('Hello Bar', $helloWorld->hello('Bar')); - } - - public function testWhat() - { - $helloWorld = new HelloWorld($this->pdo); - - $this->assertFalse($helloWorld->what()); - - $helloWorld->hello('Bar'); - - $this->assertEquals('Bar', $helloWorld->what()); - } -} + >