PageRenderTime 52ms CodeModel.GetById 26ms RepoModel.GetById 1ms app.codeStats 0ms

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

https://github.com/nextbigsound/propel-orm
PHP | 33 lines | 14 code | 4 blank | 15 comment | 0 complexity | 1d1ff4d2d7bb551ec1ed8d3ccc00360a MD5 | raw file
  1. <?php
  2. /*
  3. * $Id$
  4. * This file is part of the Propel package.
  5. * For the full copyright and license information, please view the LICENSE
  6. * file that was distributed with this source code.
  7. *
  8. * @license MIT License
  9. */
  10. require_once 'tools/helpers/bookstore/BookstoreTestBase.php';
  11. /**
  12. * Tests for SortableBehavior class
  13. *
  14. * @author Massimiliano Arione
  15. * @version $Revision$
  16. * @package generator.behavior.sortable
  17. */
  18. class SortableBehaviorTest extends BookstoreTestBase
  19. {
  20. public function testParameters()
  21. {
  22. $table11 = Table11Peer::getTableMap();
  23. $this->assertEquals(count($table11->getColumns()), 3, 'Sortable adds one columns by default');
  24. $this->assertTrue(method_exists('Table11', 'getRank'), 'Sortable adds a rank column by default');
  25. $table12 = Table12Peer::getTableMap();
  26. $this->assertEquals(count($table12->getColumns()), 4, 'Sortable does not add a column when it already exists');
  27. $this->assertTrue(method_exists('Table12', 'getPosition'), 'Sortable allows customization of rank_column name');
  28. }
  29. }