ComparisonTest.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  4. * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
  5. *
  6. * Licensed under The MIT License
  7. * For full copyright and license information, please see the LICENSE.txt
  8. * Redistributions of files must retain the above copyright notice.
  9. *
  10. * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
  11. * @link https://cakephp.org CakePHP(tm) Project
  12. * @since 3.7.5
  13. * @license https://opensource.org/licenses/mit-license.php MIT License
  14. */
  15. namespace Cake\Test\TestCase\Database\Expression;
  16. use Cake\Database\Expression\Comparison;
  17. use Cake\Database\Expression\QueryExpression;
  18. use Cake\TestSuite\TestCase;
  19. /**
  20. * Tests Comparison class
  21. */
  22. class ComparisonTest extends TestCase
  23. {
  24. /**
  25. * Tests that cloning Comparion instance clones it's value and field expressions.
  26. *
  27. * @return void
  28. */
  29. public function testClone()
  30. {
  31. $exp = new Comparison(new QueryExpression('field1'), 1, 'integer', '<');
  32. $exp2 = clone $exp;
  33. $this->assertNotSame($exp->getField(), $exp2->getField());
  34. }
  35. }