Page MenuHomeDevCentral

CodeMethodTest.php
No OneTemporary

CodeMethodTest.php

<?php
namespace Keruald\OmniTools\Reflection;
use Keruald\OmniTools\Collections\Vector;
use PHPUnit\Framework\TestCase;
use ReflectionMethod;
class CodeMethodTest extends TestCase {
public function testGetArgumentsType () {
// public function replace(iterable $iterable, int $offset = 0, int $len = 0) : self
$method = new ReflectionMethod(new Vector, "replace");
$method = CodeMethod::fromReflectionMethod($method);
$expected = Vector::from([
"iterable",
"int",
"int",
]);
$actual = $method->getArgumentsType();
$this->assertEquals($expected, $actual);
}
public function testFromReflectionMethod () {
$method = new ReflectionMethod(new Vector, "replace");
$method = CodeMethod::fromReflectionMethod($method);
$this->assertInstanceOf(CodeMethod::class, $method);
}
}

File Metadata

Mime Type
text/x-php
Expires
Sat, Nov 1, 17:54 (1 d, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3112246
Default Alt Text
CodeMethodTest.php (909 B)

Event Timeline