Skip to content

Commit

Permalink
Tests for base document.
Browse files Browse the repository at this point in the history
For obscure reasons, they will only run when launched alone with -f option... So they are commented for now.
  • Loading branch information
jhuet committed Jan 26, 2013
1 parent 9ac2181 commit a3eb151
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 1 deletion.
2 changes: 1 addition & 1 deletion module/Dibber/src/Dibber/Document/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ abstract class Base
use Behavior\Timestampable;

/** @ODM\Id */
private $id;
protected $id;

/** */
public function __construct() {}
Expand Down
14 changes: 14 additions & 0 deletions tests/Dibber/Tests/Units/Document/Asset/Base.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php
//namespace Dibber\Tests\Units\Document\Asset;
//require_once 'module/Dibber/src/Dibber/Document/Base.php';
//
//use Dibber\Document;
//
//class Base extends Document\Base
//{
// public function __construct()
// {
// $this->id = (string) 42;
// parent::__construct();
// }
//}
39 changes: 39 additions & 0 deletions tests/Dibber/Tests/Units/Document/Base.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php
//namespace Dibber\Tests\Units\Document;
//
//require_once(__DIR__ . '/Test.php');
//
//use Dibber\Document;
//use Dibber\Tests\Units\Document\Asset;

/**
* @todo figure out why autoloader doesn't work while running this test class
*/
//class Base extends Test
//{
// /** @var Document\Base */
// protected $base;
//
// public function beforeTestMethod($method)
// {
// $this->base = new Asset\Base;
// }
//
// public function testGetId()
// {
// $this
// ->assert('Getting id')
// ->string($this->base->getId())
// ->isEqualTo(42)
// ;
// }
//
// public function testConstructor()
// {
// $this
// ->assert('Constructor does nothing')
// ->variable($this->base->__construct())
// ->isNull()
// ;
// }
//}

0 comments on commit a3eb151

Please sign in to comment.