modifs.mineures sans commentaires
This commit is contained in:
parent
3d89a72029
commit
f59dfb27b0
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="PhpTestFrameworkVersionCache">
|
||||
<tools_cache>
|
||||
<tool tool_name="PHPUnit">
|
||||
<cache>
|
||||
<versions>
|
||||
<info id="Local/vendor/autoload.php" version="9.6.20" />
|
||||
</versions>
|
||||
</cache>
|
||||
</tool>
|
||||
</tools_cache>
|
||||
</component>
|
||||
</project>
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
namespace {
|
||||
function tltf_zero(): int { return 0; }
|
||||
}
|
||||
|
||||
namespace nur\sery\wip\php\impl {
|
||||
function nptf_zero(): int { return 0; }
|
||||
}
|
||||
|
||||
namespace nur\sery\wip\php {
|
||||
use nulib\tests\TestCase;
|
||||
|
||||
class funcTest extends TestCase {
|
||||
function testSimple() {
|
||||
$func = null; self::assertFalse(func::verifix_simple($func));
|
||||
$func = false; self::assertFalse(func::verifix_simple($func));
|
||||
$func = ""; self::assertFalse(func::verifix_simple($func));
|
||||
|
||||
$func = 'tltf_zero'; self::assertTrue(func::verifix_simple($func));
|
||||
self::assertSame([false, "tltf_zero"], $func);
|
||||
$func = 'tltf_zero'; self::assertTrue(func::verifix_simple($func, false));
|
||||
self::assertSame([false, "tltf_zero"], $func);
|
||||
|
||||
$func = 'nur\sery\wip\php\impl\nptf_zero'; self::assertTrue(func::verifix_simple($func));
|
||||
self::assertSame([false, 'nur\sery\wip\php\impl\nptf_zero'], $func);
|
||||
$func = 'nur\sery\wip\php\impl\nptf_zero'; self::assertTrue(func::verifix_simple($func, false));
|
||||
self::assertSame([false, 'nur\sery\wip\php\impl\nptf_zero'], $func);
|
||||
|
||||
$func = 'inexistant_function_xxx'; self::assertFalse(func::verifix_simple($func));
|
||||
$func = 'inexistant_function_xxx'; self::assertTrue(func::verifix_simple($func, false));
|
||||
self::assertSame([false, "inexistant_function_xxx"], $func);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue