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
3b665fe3
Commit
3b665fe3
authored
Aug 12, 2014
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improved unit test SKIP detection
issue #4687
parent
869d7b7c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
1 deletion
+17
-1
SphinxTestCase.php
tests/unit/extensions/sphinx/SphinxTestCase.php
+6
-0
MemCacheTest.php
tests/unit/framework/caching/MemCacheTest.php
+5
-0
MemCachedTest.php
tests/unit/framework/caching/MemCachedTest.php
+5
-0
SqliteConnectionTest.php
tests/unit/framework/db/sqlite/SqliteConnectionTest.php
+1
-1
No files found.
tests/unit/extensions/sphinx/SphinxTestCase.php
View file @
3b665fe3
...
...
@@ -48,6 +48,12 @@ class SphinxTestCase extends TestCase
if
(
!
extension_loaded
(
'pdo'
)
||
!
extension_loaded
(
'pdo_mysql'
))
{
$this
->
markTestSkipped
(
'pdo and pdo_mysql extension are required.'
);
}
// check whether sphinx is running and skip tests if not.
if
(
preg_match
(
'/host=([\w\d.]+)/i'
,
$this
->
sphinxConfig
[
'dsn'
],
$hm
)
&&
preg_match
(
'/port=(\d+)/i'
,
$this
->
sphinxConfig
[
'dsn'
],
$pm
))
{
if
(
!@
stream_socket_client
(
$hm
[
1
]
.
':'
.
$pm
[
1
],
$errorNumber
,
$errorDescription
,
0.5
))
{
$this
->
markTestSkipped
(
'No redis server running at '
.
$hm
[
1
]
.
':'
.
$pm
[
1
]
.
' : '
.
$errorNumber
.
' - '
.
$errorDescription
);
}
}
$config
=
self
::
getParam
(
'sphinx'
);
if
(
!
empty
(
$config
))
{
$this
->
sphinxConfig
=
$config
[
'sphinx'
];
...
...
tests/unit/framework/caching/MemCacheTest.php
View file @
3b665fe3
...
...
@@ -21,6 +21,11 @@ class MemCacheTest extends CacheTestCase
$this
->
markTestSkipped
(
"memcache not installed. Skipping."
);
}
// check whether memcached is running and skip tests if not.
if
(
!@
stream_socket_client
(
'127.0.0.1:11211'
,
$errorNumber
,
$errorDescription
,
0.5
))
{
$this
->
markTestSkipped
(
'No redis server running at '
.
'127.0.0.1:11211'
.
' : '
.
$errorNumber
.
' - '
.
$errorDescription
);
}
if
(
$this
->
_cacheInstance
===
null
)
{
$this
->
_cacheInstance
=
new
MemCache
();
}
...
...
tests/unit/framework/caching/MemCachedTest.php
View file @
3b665fe3
...
...
@@ -21,6 +21,11 @@ class MemCachedTest extends CacheTestCase
$this
->
markTestSkipped
(
"memcached not installed. Skipping."
);
}
// check whether memcached is running and skip tests if not.
if
(
!@
stream_socket_client
(
'127.0.0.1:11211'
,
$errorNumber
,
$errorDescription
,
0.5
))
{
$this
->
markTestSkipped
(
'No redis server running at '
.
'127.0.0.1:11211'
.
' : '
.
$errorNumber
.
' - '
.
$errorDescription
);
}
if
(
$this
->
_cacheInstance
===
null
)
{
$this
->
_cacheInstance
=
new
MemCache
([
'useMemcached'
=>
true
]);
}
...
...
tests/unit/framework/db/sqlite/SqliteConnectionTest.php
View file @
3b665fe3
...
...
@@ -122,7 +122,7 @@ class SqliteConnectionTest extends ConnectionTest
$config
=
[
'class'
=>
'yii\db\Connection'
,
'dsn'
=>
'sqlite:memory:'
,
'dsn'
=>
'sqlite:
:
memory:'
,
];
$this
->
prepareDatabase
(
$config
,
$fixture
)
->
close
();
...
...
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