AggregateExpressionTest.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 Open Group Test Suite License
  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 4.1.0
  13. * @license https://opensource.org/licenses/mit-license.php MIT License
  14. */
  15. namespace Cake\Test\TestCase\Database\Expression;
  16. use Cake\Database\Expression\AggregateExpression;
  17. use Cake\Database\ValueBinder;
  18. /**
  19. * Tests FunctionExpression class
  20. */
  21. class AggregateExpressionTest extends FunctionExpressionTest
  22. {
  23. /**
  24. * @var string The expression class to test with
  25. */
  26. protected $expressionClass = AggregateExpression::class;
  27. /**
  28. * Tests annotating an aggregate with an empty window expression
  29. *
  30. * @return void
  31. */
  32. public function testEmptyWindow()
  33. {
  34. $f = (new AggregateExpression('MyFunction'))->over();
  35. $this->assertSame('MyFunction() OVER ()', $f->sql(new ValueBinder()));
  36. }
  37. }