Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit de460b9

Browse filesBrowse files
committed
[Form] Removed remaining deprecation notices in the test suite
1 parent cc259cc commit de460b9
Copy full SHA for de460b9

File tree

4 files changed

+59
-27
lines changed
Filter options

4 files changed

+59
-27
lines changed

‎src/Symfony/Component/Form/Tests/ChoiceList/Factory/DefaultChoiceListFactoryTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/ChoiceList/Factory/DefaultChoiceListFactoryTest.php
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,9 @@ function ($object, $key, $value) {
730730
$this->assertFlatViewWithAttr($view);
731731
}
732732

733+
/**
734+
* @group legacy
735+
*/
733736
public function testCreateViewForLegacyChoiceList()
734737
{
735738
$preferred = array(new ChoiceView('Preferred', 'x', 'x'));
+29Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Form\Tests\Extension\Core\ChoiceList\Fixtures;
13+
14+
use Symfony\Component\Form\Extension\Core\ChoiceList\LazyChoiceList;
15+
16+
class LazyChoiceListImpl extends LazyChoiceList
17+
{
18+
private $choiceList;
19+
20+
public function __construct($choiceList)
21+
{
22+
$this->choiceList = $choiceList;
23+
}
24+
25+
protected function loadChoiceList()
26+
{
27+
return $this->choiceList;
28+
}
29+
}
+22Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Form\Tests\Extension\Core\ChoiceList\Fixtures;
13+
14+
use Symfony\Component\Form\Extension\Core\ChoiceList\LazyChoiceList;
15+
16+
class LazyChoiceListInvalidImpl extends LazyChoiceList
17+
{
18+
protected function loadChoiceList()
19+
{
20+
return new \stdClass();
21+
}
22+
}

‎src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/LazyChoiceListTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/LazyChoiceListTest.php
+5-27Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,25 @@
1212
namespace Symfony\Component\Form\Tests\Extension\Core\ChoiceList;
1313

1414
use Symfony\Component\Form\Extension\Core\ChoiceList\SimpleChoiceList;
15-
use Symfony\Component\Form\Extension\Core\ChoiceList\LazyChoiceList;
1615
use Symfony\Component\Form\Extension\Core\View\ChoiceView;
16+
use Symfony\Component\Form\Tests\Extension\Core\ChoiceList\Fixtures\LazyChoiceListImpl;
17+
use Symfony\Component\Form\Tests\Extension\Core\ChoiceList\Fixtures\LazyChoiceListInvalidImpl;
1718

1819
/**
1920
* @group legacy
2021
*/
2122
class LazyChoiceListTest extends \PHPUnit_Framework_TestCase
2223
{
2324
/**
24-
* @var LazyChoiceListTest_Impl
25+
* @var LazyChoiceListImpl
2526
*/
2627
private $list;
2728

2829
protected function setUp()
2930
{
3031
parent::setUp();
3132

32-
$this->list = new LazyChoiceListTest_Impl(new SimpleChoiceList(array(
33+
$this->list = new LazyChoiceListImpl(new SimpleChoiceList(array(
3334
'a' => 'A',
3435
'b' => 'B',
3536
'c' => 'C',
@@ -92,31 +93,8 @@ public function testGetValuesForChoices()
9293
*/
9394
public function testLoadChoiceListShouldReturnChoiceList()
9495
{
95-
$list = new LazyChoiceListTest_InvalidImpl();
96+
$list = new LazyChoiceListInvalidImpl();
9697

9798
$list->getChoices();
9899
}
99100
}
100-
101-
class LazyChoiceListTest_Impl extends LazyChoiceList
102-
{
103-
private $choiceList;
104-
105-
public function __construct($choiceList)
106-
{
107-
$this->choiceList = $choiceList;
108-
}
109-
110-
protected function loadChoiceList()
111-
{
112-
return $this->choiceList;
113-
}
114-
}
115-
116-
class LazyChoiceListTest_InvalidImpl extends LazyChoiceList
117-
{
118-
protected function loadChoiceList()
119-
{
120-
return new \stdClass();
121-
}
122-
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.