Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
e6f9aef3
Commit
e6f9aef3
authored
Jan 11, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed test break.
parent
cc636805
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
7 deletions
+22
-7
TestCase.php
tests/unit/TestCase.php
+2
-1
OAuth1Test.php
tests/unit/extensions/authclient/OAuth1Test.php
+10
-3
OAuth2Test.php
tests/unit/extensions/authclient/OAuth2Test.php
+10
-3
No files found.
tests/unit/TestCase.php
View file @
e6f9aef3
<?php
<?php
namespace
yiiunit
;
namespace
yiiunit
;
use
yii\helpers\ArrayHelper
;
/**
/**
* This is the base class for all yii framework unit tests.
* This is the base class for all yii framework unit tests.
...
@@ -47,7 +48,7 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase
...
@@ -47,7 +48,7 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase
];
];
$defaultConfig
[
'vendorPath'
]
=
dirname
(
dirname
(
__DIR__
))
.
'/vendor'
;
$defaultConfig
[
'vendorPath'
]
=
dirname
(
dirname
(
__DIR__
))
.
'/vendor'
;
new
$appClass
(
array_
merge
(
$defaultConfig
,
$config
));
new
$appClass
(
ArrayHelper
::
merge
(
$defaultConfig
,
$config
));
}
}
/**
/**
...
...
tests/unit/extensions/authclient/OAuth1Test.php
View file @
e6f9aef3
...
@@ -11,7 +11,15 @@ class OAuth1Test extends TestCase
...
@@ -11,7 +11,15 @@ class OAuth1Test extends TestCase
{
{
protected
function
setUp
()
protected
function
setUp
()
{
{
$this
->
mockApplication
([],
'\yii\web\Application'
);
$config
=
[
'components'
=>
[
'request'
=>
[
'hostInfo'
=>
'http://testdomain.com'
,
'scriptUrl'
=>
'/index.php'
,
],
]
];
$this
->
mockApplication
(
$config
,
'\yii\web\Application'
);
}
}
/**
/**
...
@@ -106,4 +114,4 @@ class OAuth1Test extends TestCase
...
@@ -106,4 +114,4 @@ class OAuth1Test extends TestCase
$this
->
assertContains
(
$authUrl
,
$builtAuthUrl
,
'No auth URL present!'
);
$this
->
assertContains
(
$authUrl
,
$builtAuthUrl
,
'No auth URL present!'
);
$this
->
assertContains
(
$requestTokenToken
,
$builtAuthUrl
,
'No token present!'
);
$this
->
assertContains
(
$requestTokenToken
,
$builtAuthUrl
,
'No token present!'
);
}
}
}
}
\ No newline at end of file
tests/unit/extensions/authclient/OAuth2Test.php
View file @
e6f9aef3
...
@@ -9,7 +9,15 @@ class OAuth2Test extends TestCase
...
@@ -9,7 +9,15 @@ class OAuth2Test extends TestCase
{
{
protected
function
setUp
()
protected
function
setUp
()
{
{
$this
->
mockApplication
([],
'\yii\web\Application'
);
$config
=
[
'components'
=>
[
'request'
=>
[
'hostInfo'
=>
'http://testdomain.com'
,
'scriptUrl'
=>
'/index.php'
,
],
]
];
$this
->
mockApplication
(
$config
,
'\yii\web\Application'
);
}
}
// Tests :
// Tests :
...
@@ -30,4 +38,4 @@ class OAuth2Test extends TestCase
...
@@ -30,4 +38,4 @@ class OAuth2Test extends TestCase
$this
->
assertContains
(
$clientId
,
$builtAuthUrl
,
'No client id present!'
);
$this
->
assertContains
(
$clientId
,
$builtAuthUrl
,
'No client id present!'
);
$this
->
assertContains
(
rawurlencode
(
$returnUrl
),
$builtAuthUrl
,
'No return URL present!'
);
$this
->
assertContains
(
rawurlencode
(
$returnUrl
),
$builtAuthUrl
,
'No return URL present!'
);
}
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment