I was just playing around with the Symfony Expression Language Component. Suddenly, I started to play with list() and some objects and this example came up. You can use list() and _$this_ for assigning fields. I would not recommend it, but it just funny.
class BasuritasTest extends \PHPUnit_Framework_TestCase
* @dataProvider validUsersDataProvider
* @param $id
* @param $name
public function listForObjects(int $id, string $name)
$user = new User($id, $name);
public function validUsersDataProvider()
public function __construct($id, $name)
list($this->id, $this->name) = [$id, $name];
public function id() : int
public function name() : string
The interesting thing is the line 34. The output:
PHPUnit 5.4.8 by Sebastian Bergmann and contributors.
.... 4 / 4 (100%)
Time: 56 ms, Memory: 4.00MB
OK (4 tests, 8 assertions)
That’s it. Happy Friday.