|
|
@@ -570,13 +570,15 @@ class QueryTest extends TestCase
|
|
|
'id' => 1,
|
|
|
'name' => 'tag1',
|
|
|
'_joinData' => ['article_id' => 1, 'tag_id' => 1],
|
|
|
- 'description' => 'A big description'
|
|
|
+ 'description' => 'A big description',
|
|
|
+ 'created' => new Time('2016-01-01 00:00'),
|
|
|
],
|
|
|
[
|
|
|
'id' => 2,
|
|
|
'name' => 'tag2',
|
|
|
'_joinData' => ['article_id' => 1, 'tag_id' => 2],
|
|
|
- 'description' => 'Another big description'
|
|
|
+ 'description' => 'Another big description',
|
|
|
+ 'created' => new Time('2016-01-01 00:00'),
|
|
|
]
|
|
|
]
|
|
|
],
|
|
|
@@ -591,13 +593,15 @@ class QueryTest extends TestCase
|
|
|
'id' => 1,
|
|
|
'name' => 'tag1',
|
|
|
'_joinData' => ['article_id' => 2, 'tag_id' => 1],
|
|
|
- 'description' => 'A big description'
|
|
|
+ 'description' => 'A big description',
|
|
|
+ 'created' => new Time('2016-01-01 00:00'),
|
|
|
],
|
|
|
[
|
|
|
'id' => 3,
|
|
|
'name' => 'tag3',
|
|
|
'_joinData' => ['article_id' => 2, 'tag_id' => 3],
|
|
|
- 'description' => 'Yet another one'
|
|
|
+ 'description' => 'Yet another one',
|
|
|
+ 'created' => new Time('2016-01-01 00:00'),
|
|
|
]
|
|
|
]
|
|
|
],
|
|
|
@@ -636,7 +640,8 @@ class QueryTest extends TestCase
|
|
|
'id' => 3,
|
|
|
'name' => 'tag3',
|
|
|
'_joinData' => ['article_id' => 2, 'tag_id' => 3],
|
|
|
- 'description' => 'Yet another one'
|
|
|
+ 'description' => 'Yet another one',
|
|
|
+ 'created' => new Time('2016-01-01 00:00'),
|
|
|
]
|
|
|
]
|
|
|
],
|
|
|
@@ -751,6 +756,7 @@ class QueryTest extends TestCase
|
|
|
'id' => 3,
|
|
|
'name' => 'tag3',
|
|
|
'description' => 'Yet another one',
|
|
|
+ 'created' => new Time('2016-01-01 00:00'),
|
|
|
],
|
|
|
'ArticlesTags' => ['article_id' => 2, 'tag_id' => 3]
|
|
|
]
|
|
|
@@ -777,6 +783,7 @@ class QueryTest extends TestCase
|
|
|
'id' => 2,
|
|
|
'name' => 'tag2',
|
|
|
'description' => 'Another big description',
|
|
|
+ 'created' => new Time('2016-01-01 00:00'),
|
|
|
],
|
|
|
'ArticlesTags' => ['article_id' => 1, 'tag_id' => 2]
|
|
|
]
|
|
|
@@ -814,6 +821,7 @@ class QueryTest extends TestCase
|
|
|
'id' => 2,
|
|
|
'name' => 'tag2',
|
|
|
'description' => 'Another big description',
|
|
|
+ 'created' => new Time('2016-01-01 00:00'),
|
|
|
],
|
|
|
'articles' => [
|
|
|
'id' => 1,
|
|
|
@@ -1269,16 +1277,20 @@ class QueryTest extends TestCase
|
|
|
'name' => 'tag1',
|
|
|
'_joinData' => ['article_id' => 1, 'tag_id' => 1],
|
|
|
'description' => 'A big description',
|
|
|
+ 'created' => new Time('2016-01-01 00:00'),
|
|
|
];
|
|
|
$this->assertEquals($expected, $first->tags[0]->toArray());
|
|
|
+ $this->assertInstanceOf(Time::class, $first->tags[0]->created);
|
|
|
|
|
|
$expected = [
|
|
|
'id' => 2,
|
|
|
'name' => 'tag2',
|
|
|
'_joinData' => ['article_id' => 1, 'tag_id' => 2],
|
|
|
- 'description' => 'Another big description'
|
|
|
+ 'description' => 'Another big description',
|
|
|
+ 'created' => new Time('2016-01-01 00:00'),
|
|
|
];
|
|
|
$this->assertEquals($expected, $first->tags[1]->toArray());
|
|
|
+ $this->assertInstanceOf(Time::class, $first->tags[1]->created);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -1303,7 +1315,6 @@ class QueryTest extends TestCase
|
|
|
});
|
|
|
}, 'Model.beforeFind');
|
|
|
|
|
|
-
|
|
|
$query = new Query($this->connection, $table);
|
|
|
|
|
|
$results = $query
|
|
|
@@ -1322,16 +1333,20 @@ class QueryTest extends TestCase
|
|
|
'name' => 'tag1',
|
|
|
'_joinData' => ['article_id' => 1, 'tag_id' => 1],
|
|
|
'description' => 'A big description',
|
|
|
+ 'created' => new Time('2016-01-01 00:00'),
|
|
|
];
|
|
|
$this->assertEquals($expected, $first->tags[0]->toArray());
|
|
|
+ $this->assertInstanceOf(Time::class, $first->tags[0]->created);
|
|
|
|
|
|
$expected = [
|
|
|
'id' => 2,
|
|
|
'name' => 'tag2',
|
|
|
'_joinData' => ['article_id' => 1, 'tag_id' => 2],
|
|
|
- 'description' => 'Another big description'
|
|
|
+ 'description' => 'Another big description',
|
|
|
+ 'created' => new Time('2016-01-01 00:00'),
|
|
|
];
|
|
|
$this->assertEquals($expected, $first->tags[1]->toArray());
|
|
|
+ $this->assertInstanceOf(Time::class, $first->tags[0]->created);
|
|
|
}
|
|
|
|
|
|
/**
|