MovedBitwiseTest.php 887 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Engineering;
  3. use PhpOffice\PhpSpreadsheet\Calculation\Engineering;
  4. use PHPUnit\Framework\TestCase;
  5. // Sanity tests for functions which have been moved out of Engineering
  6. // to their own classes. A deprecated version remains in Engineering;
  7. // this class contains cursory tests to ensure that those work properly.
  8. // If Scrutinizer fails the PR because of these deprecations, I will
  9. // remove this class from the PR.
  10. class MovedBitwiseTest extends TestCase
  11. {
  12. public function testMovedFunctions(): void
  13. {
  14. self::assertEquals(1, Engineering::BITAND(1, 3));
  15. self::assertEquals(3, Engineering::BITOR(1, 3));
  16. self::assertEquals(2, Engineering::BITXOR(1, 3));
  17. self::assertEquals(32, Engineering::BITLSHIFT(8, 2));
  18. self::assertEquals(2, Engineering::BITRSHIFT(8, 2));
  19. }
  20. }