Skip to content

Commit 29a33f6

Browse files
committed
Use willReturn() instead of will(returnValue()).
1 parent 177a276 commit 29a33f6

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

Tests/Loader/DelegatingLoaderTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,20 @@ public function testGetSetResolver()
3535
public function testSupports()
3636
{
3737
$loader1 = $this->getMockBuilder('Symfony\Component\Config\Loader\LoaderInterface')->getMock();
38-
$loader1->expects($this->once())->method('supports')->will($this->returnValue(true));
38+
$loader1->expects($this->once())->method('supports')->willReturn(true);
3939
$loader = new DelegatingLoader(new LoaderResolver([$loader1]));
4040
$this->assertTrue($loader->supports('foo.xml'), '->supports() returns true if the resource is loadable');
4141

4242
$loader1 = $this->getMockBuilder('Symfony\Component\Config\Loader\LoaderInterface')->getMock();
43-
$loader1->expects($this->once())->method('supports')->will($this->returnValue(false));
43+
$loader1->expects($this->once())->method('supports')->willReturn(false);
4444
$loader = new DelegatingLoader(new LoaderResolver([$loader1]));
4545
$this->assertFalse($loader->supports('foo.foo'), '->supports() returns false if the resource is not loadable');
4646
}
4747

4848
public function testLoad()
4949
{
5050
$loader = $this->getMockBuilder('Symfony\Component\Config\Loader\LoaderInterface')->getMock();
51-
$loader->expects($this->once())->method('supports')->will($this->returnValue(true));
51+
$loader->expects($this->once())->method('supports')->willReturn(true);
5252
$loader->expects($this->once())->method('load');
5353
$resolver = new LoaderResolver([$loader]);
5454
$loader = new DelegatingLoader($resolver);
@@ -62,7 +62,7 @@ public function testLoad()
6262
public function testLoadThrowsAnExceptionIfTheResourceCannotBeLoaded()
6363
{
6464
$loader = $this->getMockBuilder('Symfony\Component\Config\Loader\LoaderInterface')->getMock();
65-
$loader->expects($this->once())->method('supports')->will($this->returnValue(false));
65+
$loader->expects($this->once())->method('supports')->willReturn(false);
6666
$resolver = new LoaderResolver([$loader]);
6767
$loader = new DelegatingLoader($resolver);
6868

Tests/Loader/LoaderResolverTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function testResolve()
3232
$this->assertFalse($resolver->resolve('foo.foo'), '->resolve() returns false if no loader is able to load the resource');
3333

3434
$loader = $this->getMockBuilder('Symfony\Component\Config\Loader\LoaderInterface')->getMock();
35-
$loader->expects($this->once())->method('supports')->will($this->returnValue(true));
35+
$loader->expects($this->once())->method('supports')->willReturn(true);
3636
$resolver = new LoaderResolver([$loader]);
3737
$this->assertEquals($loader, $resolver->resolve(function () {}), '->resolve() returns the loader for the given resource');
3838
}

Tests/Loader/LoaderTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function testResolve()
3434
$resolver->expects($this->once())
3535
->method('resolve')
3636
->with('foo.xml')
37-
->will($this->returnValue($resolvedLoader));
37+
->willReturn($resolvedLoader);
3838

3939
$loader = new ProjectLoader1();
4040
$loader->setResolver($resolver);
@@ -52,7 +52,7 @@ public function testResolveWhenResolverCannotFindLoader()
5252
$resolver->expects($this->once())
5353
->method('resolve')
5454
->with('FOOBAR')
55-
->will($this->returnValue(false));
55+
->willReturn(false);
5656

5757
$loader = new ProjectLoader1();
5858
$loader->setResolver($resolver);
@@ -66,13 +66,13 @@ public function testImport()
6666
$resolvedLoader->expects($this->once())
6767
->method('load')
6868
->with('foo')
69-
->will($this->returnValue('yes'));
69+
->willReturn('yes');
7070

7171
$resolver = $this->getMockBuilder('Symfony\Component\Config\Loader\LoaderResolverInterface')->getMock();
7272
$resolver->expects($this->once())
7373
->method('resolve')
7474
->with('foo')
75-
->will($this->returnValue($resolvedLoader));
75+
->willReturn($resolvedLoader);
7676

7777
$loader = new ProjectLoader1();
7878
$loader->setResolver($resolver);
@@ -86,13 +86,13 @@ public function testImportWithType()
8686
$resolvedLoader->expects($this->once())
8787
->method('load')
8888
->with('foo', 'bar')
89-
->will($this->returnValue('yes'));
89+
->willReturn('yes');
9090

9191
$resolver = $this->getMockBuilder('Symfony\Component\Config\Loader\LoaderResolverInterface')->getMock();
9292
$resolver->expects($this->once())
9393
->method('resolve')
9494
->with('foo', 'bar')
95-
->will($this->returnValue($resolvedLoader));
95+
->willReturn($resolvedLoader);
9696

9797
$loader = new ProjectLoader1();
9898
$loader->setResolver($resolver);

0 commit comments

Comments
 (0)