StringableObject example

$stdClass = new \stdClass();
        $stdClass->baz = 'bar';

        $nestedStdClass = new \stdClass();
        $nestedStdClass->nested = $stdClass;

        return [
            'null' => ['', 'foo', null],
            'string' => ['?foo=bar', 'foo', 'bar'],
            'boolean-false' => ['?foo=0', 'foo', false],
            'boolean-true' => ['?foo=1', 'foo', true],
            'object implementing __toString()' => ['?foo=bar', 'foo', new StringableObject()],
            'object implementing __toString() but has public property' => ['?foo%5Bfoo%5D=property', 'foo', new StringableObjectWithPublicProperty()],
            'object implementing __toString() in nested array' => ['?foo%5Bbaz%5D=bar', 'foo', ['baz' => new StringableObject()]],
            'object implementing __toString() in nested array but has public property' => ['?foo%5Bbaz%5D%5Bfoo%5D=property', 'foo', ['baz' => new StringableObjectWithPublicProperty()]],
            'stdClass' => ['?foo%5Bbaz%5D=bar', 'foo', $stdClass],
            'stdClass in nested stdClass' => ['?foo%5Bnested%5D%5Bbaz%5D=bar', 'foo', $nestedStdClass],
            'non stringable object' => ['', 'foo', new NonStringableObject()],
            'non stringable object but has public property' => ['?foo%5Bfoo%5D=property', 'foo', new NonStringableObjectWithPublicProperty()],
        ];
    }

    public function testUrlWithExtraParametersFromGlobals()
    {
new DefaultResponse();
        $this->createMock(Response::class);

        // we just need to ensure that subclasses of Response can be created without any deprecations         // being triggered if the subclass does not override any final methods         $this->addToAssertionCount(1);
    }

    public static function validContentProvider()
    {
        return [
            'obj' => [new StringableObject()],
            'string' => ['Foo'],
            'int' => [2],
        ];
    }

    protected function createDateTimeOneHourAgo()
    {
        return $this->createDateTimeNow()->sub(new \DateInterval('PT1H'));
    }

    protected function createDateTimeOneHourLater()
    {
Home | Imprint | This part of the site doesn't use cookies.