コード例 #1
0
 public function setUp()
 {
     $this->fixtures('unit_tests', 'unit_tests_more');
     // paginated collection from array
     $files = array(new File(1, 'alpha'), new File(2, 'beta'), new File(3, 'gamma'), new File(4, 'delta'), new File(5, 'epsilon'), new File(6, 'zeta'), new File(7, 'eta'), new File(8, 'theta'), new File(9, 'iota'), new File(10, 'kappa'), new File(11, 'lamda'), new File(12, 'mu'), new File(13, 'nu'), new File(14, 'xi'), new File(15, 'omikron'), new File(16, 'pi'), new File(17, 'rho'), new File(18, 'sigma'), new File(19, 'tau'), new File(20, 'upsilon'), new File(21, 'phi'), new File(22, 'chi'), new File(23, 'psi'), new File(24, 'omega'));
     $this->_array = new Mad_Model_PaginatedCollection(array_slice($files, 10, 5), 3, 5, count($files));
     // paginated collection from model collection
     $testCount = UnitTest::count();
     $tests = UnitTest::find('all', array('offset' => '5', 'limit' => '5'));
     $this->_models = new Mad_Model_PaginatedCollection($tests, 2, 5, $testCount);
 }
コード例 #2
0
ファイル: BaseTest.php プロジェクト: lerre/framework
 public function testDeleteAllConditionsBind()
 {
     UnitTest::deleteAll("boolean_value = :bool", array(':bool' => '1'));
     // make sure Y record is gone
     try {
         $test = UnitTest::find(3);
         $this->fail();
     } catch (Mad_Model_Exception_RecordNotFound $e) {
         $msg = 'The record for id=3 was not found';
         $this->assertEquals($msg, $e->getMessage());
     }
     // count the records
     $this->assertEquals('3', UnitTest::count());
 }