Skip to content

Instantly share code, notes, and snippets.

@hugoboos
Last active August 29, 2015 14:16
Show Gist options
  • Select an option

  • Save hugoboos/d471df324ff678c11f0a to your computer and use it in GitHub Desktop.

Select an option

Save hugoboos/d471df324ff678c11f0a to your computer and use it in GitHub Desktop.

Revisions

  1. Hugo renamed this gist Mar 3, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. Hugo created this gist Mar 3, 2015.
    44 changes: 44 additions & 0 deletions segmentation-fault
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,44 @@
    <?php

    # src/app.php
    require_once __DIR__ . "/../vendor/autoload.php";

    $app = new Silex\Application();
    $app->register(new \Silex\Provider\MonologServiceProvider());

    $app['monolog'] = $app->share($app->extend("monolog", function($monolog, $app) {
    // Code
    }));

    $app->error(function (\Exception $exception) use ($app) {
    // Code
    });

    return $app;


    # tests/Test.php
    class Test extends \Silex\WebTestCase
    {
    public function createApplication()
    {
    return require __DIR__ . "/../src/app.php";
    }

    public function testHealthPage()
    {
    $client = $this->createClient();
    $client->request("GET", "/");
    }
    }


    # composer.json
    {
    "require": {
    "silex/silex": "~1.2",
    "monolog/monolog": "~1.12.0",
    "symfony/browser-kit": "~2.6.4",
    "phpunit/phpunit": "~4.4.5"
    }
    }