Browse Source

Added contructor test for Object, adjusted test itself

tags/2.0.0-beta
Alexander Makarov 12 years ago
parent
commit
3f6704b8d7
  1. 14
      tests/unit/framework/base/ObjectTest.php

14
tests/unit/framework/base/ObjectTest.php

@ -1,11 +1,13 @@
<?php <?php
namespace yiiunit\framework\base; namespace yiiunit\framework\base;
use yii\base\Object;
use yiiunit\TestCase;
/** /**
* ObjectTest * ObjectTest
*/ */
class ObjectTest extends \yiiunit\TestCase class ObjectTest extends TestCase
{ {
/** /**
* @var NewObject * @var NewObject
@ -112,10 +114,16 @@ class ObjectTest extends \yiiunit\TestCase
{ {
$this->assertEquals(2, $this->object->execute(1)); $this->assertEquals(2, $this->object->execute(1));
} }
public function testConstruct()
{
$object = new NewObject(array('text' => 'test text'));
$this->assertEquals('test text', $object->getText());
}
} }
class NewObject extends \yii\base\Component class NewObject extends Object
{ {
private $_object = null; private $_object = null;
private $_text = 'default'; private $_text = 'default';

Loading…
Cancel
Save