ArrayStatement example

// dbal 2.x         if (interface_exists(Result::class)) {
            $driverConnection
                ->expects(self::exactly(2))
                ->method('getWrappedConnection')
                ->willReturn($wrappedConnection);

            $driverConnection
                ->expects(self::any())
                ->method('executeQuery')
                ->willReturn(new ArrayStatement([]));
        } else {
            // dbal 3.x             $driverConnection
                ->expects(self::exactly(2))
                ->method('getNativeConnection')
                ->willReturn($wrappedConnection);

            $driverConnection
                ->expects(self::any())
                ->method('executeQuery')
                ->willReturn(new Result(new ArrayResult([])$driverConnection));
        }
Home | Imprint | This part of the site doesn't use cookies.