"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/framework/web/UserTest.php" between
yii2-2.0.35.tar.gz and yii2-2.0.36.tar.gz

About: Yii 2 is a high-performance component-based PHP framework for developing large-scale Web applications (source).

UserTest.php  (yii2-2.0.35):UserTest.php  (yii2-2.0.36)
skipping to change at line 353 skipping to change at line 353
$this->mockWebApplication($appConfig); $this->mockWebApplication($appConfig);
$this->reset(); $this->reset();
$_SERVER['HTTP_ACCEPT'] = 'text/json,q=0.1'; $_SERVER['HTTP_ACCEPT'] = 'text/json,q=0.1';
$this->expectException('yii\\web\\ForbiddenHttpException'); $this->expectException('yii\\web\\ForbiddenHttpException');
Yii::$app->user->loginRequired(); Yii::$app->user->loginRequired();
} }
public function testAccessChecker() public function testAccessChecker()
{ {
$appConfig = [ $this->mockWebApplication([
'components' => [ 'components' => [
'user' => [ 'user' => [
'identityClass' => UserIdentity::className(), 'identityClass' => UserIdentity::className(),
'accessChecker' => AccessChecker::className() 'accessChecker' => AccessChecker::className()
] ]
], ],
]; ]);
$this->assertInstanceOf(AccessChecker::className(), Yii::$app->user->acc
essChecker);
$this->mockWebApplication($appConfig); $this->mockWebApplication([
'components' => [
'user' => [
'identityClass' => UserIdentity::className(),
'accessChecker' => [
'class' => AccessChecker::className(),
],
],
],
]);
$this->assertInstanceOf(AccessChecker::className(), Yii::$app->user->acc
essChecker);
$this->mockWebApplication([
'components' => [
'user' => [
'identityClass' => UserIdentity::className(),
'accessChecker' => 'accessChecker',
],
'accessChecker' => [
'class' => AccessChecker::className(),
]
],
]);
$this->assertInstanceOf(AccessChecker::className(), Yii::$app->user->acc essChecker); $this->assertInstanceOf(AccessChecker::className(), Yii::$app->user->acc essChecker);
} }
public function testGetIdentityException() public function testGetIdentityException()
{ {
$session = $this->getMock('yii\web\Session'); $session = $this->getMock('yii\web\Session');
$session->method('getHasSessionId')->willReturn(true); $session->method('getHasSessionId')->willReturn(true);
$session->method('get')->with($this->equalTo('__id'))->willReturn('1'); $session->method('get')->with($this->equalTo('__id'))->willReturn('1');
$appConfig = [ $appConfig = [
 End of changes. 3 change blocks. 
3 lines changed or deleted 28 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)