8000 fix tests for the `AbstractVoter` class · xabbuh/symfony@6055022 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6055022

Browse files
committed
fix tests for the AbstractVoter class
* The `LegacyAbstractVoterTest` class is not needed anymore, tests have been moved to the `AbstractVoterTest` class tagging them with the legacy group. * Tests are applied on `stdClass` object instances. Thus, the legacy voter fixture class must not support `AbstractVoterTest_Object` instances, but support `stdClass` objects instead. * Remove a test that checked for a `BadMethodCallException` being thrown. This seems to have been added accidentally in symfony#15961.
1 parent 634aafc commit 6055022

File tree

2 files changed

+1
-53
lines changed

2 files changed

+1
-53
lines changed

src/Symfony/Component/Security/Core/Tests/Authorization/Voter/AbstractVoterTest.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,6 @@ public function testVoteLegacy(array $attributes, $expectedVote, $object, $messa
6565

6666
$this->assertEquals($expectedVote, $voter->vote($this->token, $object, $attributes), $message);
6767
}
68-
69-
/**
70-
* @group legacy
71-
* @expectedException \BadMethodCallException
72-
*/
73-
public function testNoOverriddenMethodsThrowsException()
74-
{
75-
$voter = new AbstractVoterTest_NothingImplementedVoter();
76-
$voter->vote($this->token, new \stdClass(), array('EDIT'));
77-
}
7868
}
7969

8070
class AbstractVoterTest_Voter extends AbstractVoter
@@ -95,7 +85,7 @@ class AbstractVoterTest_LegacyVoter extends AbstractVoter
9585
{
9686
protected function getSupportedClasses()
9787
{
98-
return array('AbstractVoterTest_Object');
88+
return array('stdClass');
9989
}
10090

10191
protected function getSupportedAttributes()

src/Symfony/Component/Security/Core/Tests/Authorization/Voter/LegacyAbstractVoterTest.php

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0