CakeRuleTest.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /**
  3. * CakeRuleTest file
  4. *
  5. * PHP 5
  6. *
  7. * CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
  8. * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
  9. *
  10. * Licensed under The MIT License
  11. * Redistributions of files must retain the above copyright notice
  12. *
  13. * @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
  14. * @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
  15. * @package Cake.Test.Case.Model.Validator
  16. * @since CakePHP(tm) v 2.2.0
  17. * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
  18. */
  19. require_once dirname(dirname(__FILE__)) . DS . 'ModelTestBase.php';
  20. /**
  21. * CakeRuleTest
  22. *
  23. * @package Cake.Test.Case.Model.Validator
  24. */
  25. class CakeRuleTest extends BaseModelTest {
  26. /**
  27. * setUp method
  28. *
  29. * @return void
  30. */
  31. public function setUp() {
  32. parent::setUp();
  33. $Article = new Article();
  34. $Article->set(array('title' => '', 'body' => 'no title'));
  35. $this->Validator = new ModelValidator($Article);
  36. $this->Validator->getData();
  37. $rule = array('notEmpty' => array('rule' => 'notEmpty', 'required' => true, 'last' => false));
  38. $this->Field = new CakeField($this->Validator, 'body', $rule);
  39. }
  40. /**
  41. * testIsValid method
  42. *
  43. * @return void
  44. */
  45. public function testIsValid() {
  46. }
  47. }