From a3388622287e218beddfa14a47ed677d4307b36b Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Fri, 25 Mar 2016 17:55:51 +0100 Subject: Removed simpletest and moved all tests in the unit tree Tests are executed now, but a lot of them need fixing. --- tests/unit/Data/ActiveRecord/RecordEventTest.php | 38 ++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 tests/unit/Data/ActiveRecord/RecordEventTest.php (limited to 'tests/unit/Data/ActiveRecord/RecordEventTest.php') diff --git a/tests/unit/Data/ActiveRecord/RecordEventTest.php b/tests/unit/Data/ActiveRecord/RecordEventTest.php new file mode 100644 index 00000000..0114e0a4 --- /dev/null +++ b/tests/unit/Data/ActiveRecord/RecordEventTest.php @@ -0,0 +1,38 @@ +setDbConnection($conn); + } + + function testFindByPk() + { + $user1 = UserRecord::finder()->findByPk('admin'); + $this->assertNotNull($user1); + } + + function test_same_data_returns_same_object() + { + $criteria = new TActiveRecordCriteria('username = ?', 'admin'); + $finder = new UserRecord(); + $finder->OnCreateCommand[] = array($this, 'logger'); + $finder->OnExecuteCommand[] = array($this, 'logger'); + $user1 = $finder->find($criteria); + //var_dump($user1); + + //var_dump(UserRecord::finder()->find($criteria)); + } + + function logger($sender, $param) + { + //var_dump($param); + } +} -- cgit v1.2.3