propel /test/testsuite/generator/behavior/sortable/SortableBehaviorTest.php

Language PHP Lines 35
MD5 Hash 30e80025a5138296e4487597b3212d60
Repository https://github.com/mattleff/propel.git View Raw File View Project SPDX
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php

/*
 *	$Id: SortableBehaviorTest.php 1834 2010-07-20 21:14:29Z francois $
 * This file is part of the Propel package.
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @license    MIT License
 */

require_once dirname(__FILE__) . '/../../../../tools/helpers/bookstore/BookstoreTestBase.php';

/**
 * Tests for SortableBehavior class
 *
 * @author		Massimiliano Arione
 * @version		$Revision: 1834 $
 * @package		generator.behavior.sortable
 */
class SortableBehaviorTest extends BookstoreTestBase
{

	public function testParameters()
	{
		$table11 = Table11Peer::getTableMap();
		$this->assertEquals(count($table11->getColumns()), 3, 'Sortable adds one columns by default');
		$this->assertTrue(method_exists('Table11', 'getRank'), 'Sortable adds a rank column by default');
		$table12 = Table12Peer::getTableMap();
		$this->assertEquals(count($table12->getColumns()), 4, 'Sortable does not add a column when it already exists');
		$this->assertTrue(method_exists('Table12', 'getPosition'), 'Sortable allows customization of rank_column name');
	}

}
Back to Top