Commit 3f6704b8 by Alexander Makarov

Added contructor test for Object, adjusted test itself

parent 8878fb91
<?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 ...@@ -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';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment