Skip to content

Commit c0a966b

Browse files
committed
Add a Test
Prove you can't override a built-in function.
1 parent 53bce34 commit c0a966b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tests/PhpSpreadsheetTests/Calculation/CustomFunctionTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public static function testCustomFunction(): void
2121
'argumentCount' => '1',
2222
];
2323
self::assertTrue(Calculation::addFunction($key, $value));
24+
self::assertFalse(Calculation::addFunction('sqrt', $value));
2425
self::assertSame(16, $calculation->calculateFormula('=FOURTHPOWER(2)'));
2526
self::assertSame('#VALUE!', $calculation->calculateFormula('=FOURTHPOWER("X")'));
2627
self::assertSame('#NAME?', $calculation->calculateFormula('=FOURTHPOWE("X")'));

0 commit comments

Comments
 (0)