Raised DBAL version from 1.1.5 to 1.1.6
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Tests / Persistence / Query_testcase.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 2009 Christopher Hlubek <hlubek@networkteam.com>
6 * All rights reserved
7 *
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 *
17 * This script is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * This copyright notice MUST APPEAR in all copies of the script!
23 ***************************************************************/
24
25 class Tx_Extbase_Persistence_Query_testcase extends Tx_Extbase_BaseTestCase {
26
27 public function setUp() {
28 }
29
30 /**
31 * @test
32 * @expectedException InvalidArgumentException
33 */
34 public function setLimitAcceptsOnlyIntegers() {
35 $query = new Tx_Extbase_Persistence_Query('Foo_Class_Name');
36 $query->setLimit(1.5);
37 }
38
39 /**
40 * @test
41 * @expectedException InvalidArgumentException
42 */
43 public function setLimitRejectsIntegersLessThanOne() {
44 $query = new Tx_Extbase_Persistence_Query('Foo_Class_Name');
45 $query->setLimit(0);
46 }
47
48 /**
49 * @test
50 * @expectedException InvalidArgumentException
51 */
52 public function setOffsetAcceptsOnlyIntegers() {
53 $query = new Tx_Extbase_Persistence_Query('Foo_Class_Name');
54 $query->setOffset(1.5);
55 }
56
57 /**
58 * @test
59 * @expectedException InvalidArgumentException
60 */
61 public function setOffsetRejectsIntegersLessThanZero() {
62 $query = new Tx_Extbase_Persistence_Query('Foo_Class_Name');
63 $query->setOffset(-1);
64 }
65
66 }
67 ?>