Created
July 14, 2013 16:24
-
-
Save cybrown/5994819 to your computer and use it in GitHub Desktop.
Basic testable Silex application with travis, phpunit, composer and gitignore files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /composer.lock | |
| /vendor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| language: php | |
| php: | |
| - 5.5 | |
| - 5.4 | |
| - 5.3 | |
| before_script: | |
| - composer install | |
| script: vendor/bin/phpunit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // src/app.php | |
| require_once __DIR__.'/../vendor/autoload.php'; | |
| $app = new Silex\Application(); | |
| $app->get('/', function () use ($app) { | |
| return '<a href="/hello/world">Link to hello world</a>'; | |
| }); | |
| $app->get('/hello/{name}', function ($name) use ($app) { | |
| return 'Hello '.$app->escape($name); | |
| }); | |
| return $app; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "require": { | |
| "silex/silex": "1.*" | |
| }, | |
| "require-dev": { | |
| "phpunit/phpunit": "*", | |
| "symfony/browser-kit": "*" | |
| }, | |
| "autoload": { | |
| "psr-0": {"APP_NAMESPACE_HERE\\": "src/"} | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // web/index.php | |
| $app = require_once __DIR__ . '/../src/app.php'; | |
| $app->run(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <phpunit backupGlobals="false" | |
| backupStaticAttributes="false" | |
| convertErrorsToExceptions="true" | |
| convertNoticesToExceptions="true" | |
| convertWarningsToExceptions="true" | |
| processIsolation="false" | |
| stopOnFailure="false" | |
| syntaxCheck="false" | |
| > | |
| <testsuites> | |
| <testsuite name="NAME HERE !!! Test Suite"> | |
| <directory>./tests/</directory> | |
| </testsuite> | |
| </testsuites> | |
| </phpunit> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #command line for php 5.4+ integrated server | |
| php -S 127.0.0.1:8080 web/index.php -t web |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment