public function testResolve()
{
$resolver = new AggregateResolver();
$this->assertTrue($resolver instanceof ResolverInterface);
$lowPriority = $this->getMock(ResolverInterface::class);
$lowPriority->expects($this->once())->method('resolve')->with('to-be-resolved')->will($this->returnValue('first'));
$resolver->attach($lowPriority);
$this->assertSame('first', $resolver->resolve('to-be-resolved'));
$highPriority = $this->getMock(ResolverInterface::class);
$highPriority->expects($this->exactly(2))->method('resolve')->with('to-be-resolved')->will($this->returnValue('second'));
$resolver->attach($highPriority, 1000);
$this->assertSame('second', $resolver->resolve('to-be-resolved'));
$averagePriority = $this->getMock(ResolverInterface::class);
$averagePriority->expects($this->never())->method('resolve')->will($this->returnValue('third'));
$resolver->attach($averagePriority, 500);
$this->assertSame('second', $resolver->resolve('to-be-resolved'));
}