Skip to content
This repository has been archived by the owner on Aug 13, 2023. It is now read-only.

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rez1dent3 committed Jan 16, 2017
1 parent 3473519 commit 242c9e8
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
36 changes: 36 additions & 0 deletions demo/framework.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

include_once dirname(__DIR__) . '/vendor/autoload.php';

class Framework extends \Deimos\DI\DI
{

protected function configure()
{
$this->value('project', 'Deimos');
$this->value('version', 0.1);

$this->callback('info', function ()
{
return implode(' ', [
$this->project(),
$this->version()
]);
});

}

}

$framework = new Framework();

echo Framework::info();

try
{
echo \Deimos\DI\ContainerEmpty::info();
}
catch (Error $error) // php 7+
{
var_dump($error);
}
6 changes: 6 additions & 0 deletions tests/Test/DITest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Deimos\DI\Argument;
use Deimos\DI\ContainerEmpty;
use Deimos\DI\Group;
use DeimosTest\DI;
use DeimosTest\Person;
use DeimosTest\TestSetUp;

Expand Down Expand Up @@ -99,4 +100,9 @@ public function testTree()
$this->assertNotEquals($nine, $this->di->get('nine'));
}

public function testStatic()
{
$this->assertInstanceOf(Group::class, DI::l1());
}

}

0 comments on commit 242c9e8

Please sign in to comment.