<?php

/**
 * Class MagicTest
 */
class MagicTest extends PHPUnit_Framework_TestCase
{
    /**
     *
     */
    public function testAssertIsInvokable()
    {
        $this->assertInstanceOf('\Invokable', new ExampleClass());
    }

    /**
     *
     */
    public function testAssertStringifiable()
    {
        $this->assertInstanceOf('\Stringifiable', new ExampleClass());
    }

    /**
     *
     */
    public function testAssertArrayable()
    {
        $this->assertInstanceOf('\Arrayable', new ExampleClass());
    }

    /**
     *
     */
    public function testAssertArrayableReturn()
    {
        $o = new ExampleClass();
        $this->assertContainsOnly('string', $o->toArray());
    }

}
<?php

/**
 * Class MagicTest
 */
class MagicTest extends PHPUnit_Framework_TestCase
{
    /**
     *
     */
    public function testAssertIsInvokable()
    {
        $this->assertInstanceOf('\Invokable', new ExampleClass());
    }

    /**
     *
     */
    public function testAssertStringifiable()
    {
        $this->assertInstanceOf('\Stringifiable', new ExampleClass());
    }

    /**
     *
     */
    public function testAssertArrayable()
    {
        $this->assertInstanceOf('\Arrayable', new ExampleClass());
    }

    /**
     *
     */
    public function testAssertArrayableReturn()
    {
        $this->assertContainsOnly('string', (new ExampleClass())->toArray());
    }

}
--- 
+++ 
@@ -34,7 +34,8 @@
      */
     public function testAssertArrayableReturn()
     {
-        $this->assertContainsOnly('string', (new ExampleClass())->toArray());
+        $o = new ExampleClass();
+        $this->assertContainsOnly('string', $o->toArray());
     }
 
 }
Fix object creation 5.3 compatible
