Chaining is the same as a scope increment. It needs to earn one indentation level.
Also, chaining calls on a single line is prohibited in Object Calisthenics.
Here is the code updated:

```php
$metadataFactory
    ->expects($this->once())
    ->method('getMetadataFor')
    ->will($this->returnValue($metadata));
```