Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
terdia committed Apr 22, 2018
2 parents ede213c + 0cef2d6 commit d299e6d
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 2 deletions.
18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
language: "php"

php:
- 7.0
- 7.1
- 7.2
- hhvm

before_script:
- "composer require codeclimate/php-test-reporter --dev"
- "composer install"

script:
- "phpunit --testsuite=unit --coverage-text --coverage-clover build/logs/clover.xml"

after_script:
- CODECLIMATE_REPO_TOKEN="f9d5aa4587b21a32915c66c696be0149f802344962e7dd2d60431d629068ce52" vendor/bin/test-reporter --stdout > codeclimate.json
- "sh -c 'if [ \"$TRAVIS_PHP_VERSION\" != \"hhvm\" ]; then curl -X POST -d @codeclimate.json -H \"Content-Type: application/json\" -H \"User-Agent: Code Climate (PHP Test Reporter v0.1.1)\" https://codeclimate.com/test_reports ; fi'"
2 changes: 1 addition & 1 deletion cache/blade/4aa9b31e5d2e6e93672b16f1e6d6b8e9cfaef9ae.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<?php $__env->startSection('body'); ?>
<div class="text-center">
<h1><?php echo e(getenv('APP_NAME')); ?> v1</h1>
<p>Start building that next app.</p>
<p>Start building that next appx</p>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.base', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
],
"require": {
"php": ">=7.0.0",
"legato/framework": "^1.0"
"legato/framework": "^1.0",
"phpunit/phpunit": "^7.1"
},
"autoload": {
"psr-4": {
Expand Down
8 changes: 8 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="vendor/autoload.php" colors="true">
<testsuites>
<testsuite name="unit">
<directory>tests</directory>
</testsuite>
</testsuites>
</phpunit>
29 changes: 29 additions & 0 deletions tests/RouteTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php
namespace Tests;

use GuzzleHttp\Client;
use PHPUnit\Framework\TestCase;

class RouteTest extends TestCase
{
protected $client;

public function setUp()
{
parent::setUp();
$this->client = new Client;
}

/**
* @test
*/
public function can_see_app_home_page()
{
$home_url = 'http://local.legato.com/';
$response = $this->client->get($home_url);

$contents = $response->getBody()->getContents();
$this->assertContains('Start building that next app.', $contents);
$this->assertSame(200, $response->getStatusCode());
}
}

0 comments on commit d299e6d

Please sign in to comment.