PageRenderTime 35ms CodeModel.GetById 10ms RepoModel.GetById 1ms app.codeStats 0ms

/app/tests/cases/models/link.test.php

https://github.com/hardsshah/bookmarks
PHP | 34 lines | 27 code | 5 blank | 2 comment | 0 complexity | b453a544fcca4ca972178fbe28a3cf1c MD5 | raw file
  1. <?php
  2. /* SVN FILE: $Id$ */
  3. /* Link Test cases generated on: 2009-03-08 21:03:21 : 1236562161*/
  4. App::import('Model', 'Link');
  5. class LinkTestCase extends CakeTestCase {
  6. var $Link = null;
  7. var $fixtures = array('app.link');
  8. function startTest() {
  9. $this->Link =& ClassRegistry::init('Link');
  10. }
  11. function testLinkInstance() {
  12. $this->assertTrue(is_a($this->Link, 'Link'));
  13. }
  14. function testLinkFind() {
  15. $this->Link->recursive = -1;
  16. $results = $this->Link->find('first');
  17. $this->assertTrue(!empty($results));
  18. $expected = array('Link' => array(
  19. 'id' => 1,
  20. 'link_category_id' => 1,
  21. 'name' => 'Lorem ipsum dolor sit amet',
  22. 'url' => 'Lorem ipsum dolor sit amet',
  23. 'created' => '2009-03-08 21:29:21',
  24. 'modified' => '2009-03-08 21:29:21'
  25. ));
  26. $this->assertEqual($results, $expected);
  27. }
  28. }
  29. ?>