Skip to content

Commit

Permalink
Update testRandomGeneratorCreatesRandomState test
Browse files Browse the repository at this point in the history
Changes the Generator mock to expect a character set integer (in this
case 7 which is the Generator::CHAR_ALNUM constant).
  • Loading branch information
johnnoel committed Jul 28, 2016
1 parent 4e2e4fc commit c916abb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/src/Provider/AbstractProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function testAuthorizationUrlStateParam()
'state' => 'XXX'
]));
}

/**
* Tests https://github.com/thephpleague/oauth2-client/pull/485
*/
Expand All @@ -75,7 +75,7 @@ public function testCustomAuthorizationUrlOptions()
]);
$query = parse_url($url, PHP_URL_QUERY);
$this->assertNotEmpty($query);

parse_str($query, $params);
$this->assertArrayHasKey('foo', $params);
$this->assertSame('BAR', $params['foo']);
Expand Down Expand Up @@ -307,7 +307,7 @@ public function testRandomGeneratorCreatesRandomState()
$xstate = str_repeat('x', 32);

$generator = m::mock(RandomGenerator::class);
$generator->shouldReceive('generateString')->with(32)->times(1)->andReturn($xstate);
$generator->shouldReceive('generateString')->with(32, 7)->times(1)->andReturn($xstate);

$factory = m::mock(RandomFactory::class);
$factory->shouldReceive('getMediumStrengthGenerator')->times(1)->andReturn($generator);
Expand Down

0 comments on commit c916abb

Please sign in to comment.