|
|
|
@ -1,11 +1,13 @@
|
|
|
|
|
<?php |
|
|
|
|
|
|
|
|
|
namespace yiiunit\framework\base; |
|
|
|
|
|
|
|
|
|
use yii\base\Object; |
|
|
|
|
use yiiunit\TestCase; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* ObjectTest |
|
|
|
|
*/ |
|
|
|
|
class ObjectTest extends \yiiunit\TestCase |
|
|
|
|
class ObjectTest extends TestCase |
|
|
|
|
{ |
|
|
|
|
/** |
|
|
|
|
* @var NewObject |
|
|
|
@ -112,10 +114,16 @@ class ObjectTest extends \yiiunit\TestCase
|
|
|
|
|
{ |
|
|
|
|
$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 $_text = 'default'; |
|
|
|
|