From 3dbb3d40ddc68c67e5cada32fc09975cb66c3179 Mon Sep 17 00:00:00 2001 From: Paul Klimov Date: Thu, 28 Nov 2013 11:34:13 +0200 Subject: [PATCH] Sphinx unit tests fixed. --- extensions/sphinx/ActiveRecord.php | 2 ++ tests/unit/extensions/sphinx/ActiveRecordTest.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/extensions/sphinx/ActiveRecord.php b/extensions/sphinx/ActiveRecord.php index 9cf03ff..206c340 100644 --- a/extensions/sphinx/ActiveRecord.php +++ b/extensions/sphinx/ActiveRecord.php @@ -1385,6 +1385,8 @@ abstract class ActiveRecord extends Model $this->populateRelation($offset, $item); return; } + } catch (InvalidParamException $e) { + // shut down exception : has getter, but not relation } catch (UnknownMethodException $e) { throw $e->getPrevious(); } diff --git a/tests/unit/extensions/sphinx/ActiveRecordTest.php b/tests/unit/extensions/sphinx/ActiveRecordTest.php index 0bb9dbb..b167b9e 100644 --- a/tests/unit/extensions/sphinx/ActiveRecordTest.php +++ b/tests/unit/extensions/sphinx/ActiveRecordTest.php @@ -79,10 +79,10 @@ class ActiveRecordTest extends SphinxTestCase // asArray $article = ArticleIndex::find()->where('id=2')->asArray()->one(); + unset($article['add_date']); $this->assertEquals([ 'id' => '2', 'author_id' => '2', - 'add_date' => '1384466400', 'tag' => '3,4', ], $article);