Ouzo\Tests\ModelAttributesMatcher::__toString PHP Method

__toString() public method

public __toString ( )
    public function __toString()
    {
        $attributes = print_r($this->expectedAttributes, true);
        return get_class($this->expected) . " with attributes({$attributes})";
    }

Usage Example

 /**
  * @test
  */
 public function shouldReturnDescription()
 {
     //given
     $model = new Product(array('name' => 'product1'));
     $matcher = new ModelAttributesMatcher($model);
     //when
     $description = $matcher->__toString();
     //then
     $attributes = print_r($model->attributes(), true);
     $this->assertEquals("Application\\Model\\Test\\Product with attributes({$attributes})", $description);
 }