コード例 #1
0
 public function testResolveLazyReplaceDefaults()
 {
     $test = $this;
     $this->resolver->setDefaults(array('one' => function (Options $options) use($test) {
         /* @var \PHPUnit_Framework_TestCase $test */
         $test->fail('Previous closure should not be executed');
     }));
     $this->resolver->replaceDefaults(array('one' => function (Options $options, $previousValue) {
         return '1';
     }));
     $this->assertEquals(array('one' => '1'), $this->resolver->resolve(array()));
 }