AspectMock icon indicating copy to clipboard operation
AspectMock copied to clipboard

Error in Generators

Open titanrat opened this issue 8 years ago • 0 comments

I have a similar problem with https://github.com/Codeception/AspectMock/pull/66

When i try to mock laravel database (v5.2.45) file /vendor/illuminate/database/Query/Builder.php

/** * Get a generator for the given query. * * @return \Generator */ public function cursor() { if (is_null($this->columns)) { $this->columns = ['*']; } return $this->connection->cursor( $this->toSql(), $this->getBindings(), ! $this->useWritePdo ); } Something goes wrong with this function, and tests fails with

PHP Fatal error: Generators cannot return values using "return" in /www/backend/vendor/illuminate/database/Query/Builder.php on line 1750

How can I fix this?

titanrat avatar Nov 01 '17 14:11 titanrat