|
|
@@ -4,6 +4,7 @@ namespace Tools\Test\TestCase\Model\Behavior;
|
|
|
|
|
|
use Cake\Core\Configure;
|
|
|
use Cake\ORM\TableRegistry;
|
|
|
+use stdClass;
|
|
|
use Tools\Model\Behavior\JsonableBehavior;
|
|
|
use Tools\TestSuite\TestCase;
|
|
|
|
|
|
@@ -247,8 +248,8 @@ class JsonableBehaviorTest extends TestCase {
|
|
|
$this->Comments->save($entity);
|
|
|
|
|
|
$res = $this->Comments->find('all', ['conditions' => ['title' => 'param']])->first();
|
|
|
- $obj = new \stdClass();
|
|
|
- $obj->x = new \stdClass();
|
|
|
+ $obj = new stdClass();
|
|
|
+ $obj->x = new stdClass();
|
|
|
$obj->x->y = 'z';
|
|
|
$expected = $obj;
|
|
|
$this->assertEquals($expected, $res['details']);
|
|
|
@@ -272,7 +273,7 @@ class JsonableBehaviorTest extends TestCase {
|
|
|
$this->Comments->save($entity);
|
|
|
|
|
|
$res = $this->Comments->find('all', ['conditions' => ['title' => 'param']])->first();
|
|
|
- $obj = new \stdClass();
|
|
|
+ $obj = new stdClass();
|
|
|
$obj->y = 'yy';
|
|
|
$expected = $obj;
|
|
|
$this->assertEquals($expected, $res['details']);
|
|
|
@@ -316,8 +317,8 @@ class JsonableBehaviorTest extends TestCase {
|
|
|
|
|
|
// Test decode with default params
|
|
|
$res = $this->Comments->find('all', ['conditions' => ['title' => 'param']])->first();
|
|
|
- $obj = new \stdClass();
|
|
|
- $obj->x = new \stdClass();
|
|
|
+ $obj = new stdClass();
|
|
|
+ $obj->x = new stdClass();
|
|
|
$obj->x->y = 'z';
|
|
|
$expected = $obj;
|
|
|
$this->assertEquals($expected, $res['details']);
|