luyatests\core\helpers\ObjectHelperTest::testOptionalArgMixin PHP Method

testOptionalArgMixin() public method

    public function testOptionalArgMixin()
    {
        $response = ObjectHelper::callMethodSanitizeArguments(new TestObject(), 'm3', ['foo' => 'bar']);
        $this->assertSame(true, is_array($response));
        $this->assertArrayHasKey(0, $response);
        $this->assertArrayHasKey(1, $response);
        $this->assertEquals("bar", $response[0]);
        $this->assertEquals('baz', $response[1]);
        $response = ObjectHelper::callMethodSanitizeArguments(new TestObject(), 'm3', ['foo' => 'bar', 'bar' => 'notbaz']);
        $this->assertSame(true, is_array($response));
        $this->assertArrayHasKey(0, $response);
        $this->assertArrayHasKey(1, $response);
        $this->assertEquals("bar", $response[0]);
        $this->assertEquals('notbaz', $response[1]);
    }