Browse Source

Using Composer to get dBug. Fixes #2

master
Adam Backstrom 8 years ago
parent
commit
f6979edb76
  1. 2
      .gitignore
  2. 3
      Makefile
  3. 2
      classes.php
  4. 5
      composer.json
  5. 7
      index.php
  6. 10
      tests/DbugFormatterTest.php
  7. 6
      tests/bootstrap.php

2
.gitignore

@ -0,0 +1,2 @@
composer.lock
vendor

3
Makefile

@ -1,2 +1,5 @@
all:
composer install
test:
phpunit --bootstrap tests/bootstrap.php tests

2
classes.php

@ -1,5 +1,7 @@
<?php
use \Ospinto\Dbug;
abstract class AbstractAction
{
protected $value;

5
composer.json

@ -0,0 +1,5 @@
{
"require": {
"sunra/dbug": "dev-master"
}
}

7
index.php

@ -9,9 +9,10 @@
<?php
require_once 'dBug.php';
require_once 'classes.php';
require_once 'functions.php';
require __DIR__ . '/vendor/autoload.php';
require __DIR__ . '/classes.php';
require __DIR__ . '/functions.php';
?>

10
tests/DbugFormatterTest.php

@ -0,0 +1,10 @@
<?php
class DbugFormatterTest extends PHPUnit_Framework_TestCase {
function testFormat() {
$formatter = new DbugFormatter;
$s = 'mine' . $_SERVER['REQUEST_TIME'] . sha1(time() . mt_rand());
$this->assertContains($s, $formatter->format($s));
}
}

6
tests/bootstrap.php

@ -2,6 +2,6 @@
date_default_timezone_set('UTC');
require_once 'dBug.php';
require_once 'classes.php';
require_once 'functions.php';
require dirname(__DIR__) . '/vendor/autoload.php';
require dirname(__DIR__) . '/classes.php';
require dirname(__DIR__) . '/functions.php';
Loading…
Cancel
Save