ComparisonTest.php 1.2 KB

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