Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
db710e0b
Unverified
Commit
db710e0b
authored
8 years ago
by
Joas Schilling
Browse files
Options
Downloads
Patches
Plain Diff
Make tests work with 4.8 at least
parent
05436610
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
autotest-external.sh
+3
-3
3 additions, 3 deletions
autotest-external.sh
autotest.sh
+3
-3
3 additions, 3 deletions
autotest.sh
tests/lib/TestCase.php
+18
-0
18 additions, 0 deletions
tests/lib/TestCase.php
with
24 additions
and
6 deletions
autotest-external.sh
+
3
−
3
View file @
db710e0b
...
...
@@ -31,7 +31,7 @@ function print_syntax {
}
if
!
[
-x
"
$PHPUNIT
"
]
;
then
echo
"phpunit executable not found, please install phpunit version >=
3.7
"
>
&2
echo
"phpunit executable not found, please install phpunit version >=
4.8
"
>
&2
exit
3
fi
...
...
@@ -39,8 +39,8 @@ PHPUNIT_VERSION=$("$PHPUNIT" --version | cut -d" " -f2)
PHPUNIT_MAJOR_VERSION
=
$(
echo
$PHPUNIT_VERSION
|
cut
-d
"."
-f1
)
PHPUNIT_MINOR_VERSION
=
$(
echo
$PHPUNIT_VERSION
|
cut
-d
"."
-f2
)
if
!
[
$PHPUNIT_MAJOR_VERSION
-gt
4
-o
\(
$PHPUNIT_MAJOR_VERSION
-eq
4
-a
$PHPUNIT_MINOR_VERSION
-ge
4
\)
]
;
then
echo
"phpunit version >= 4.
4
required. Version found:
$PHPUNIT_VERSION
"
>
&2
if
!
[
$PHPUNIT_MAJOR_VERSION
-gt
4
-o
\(
$PHPUNIT_MAJOR_VERSION
-eq
4
-a
$PHPUNIT_MINOR_VERSION
-ge
8
\)
]
;
then
echo
"phpunit version >= 4.
8
required. Version found:
$PHPUNIT_VERSION
"
>
&2
exit
4
fi
...
...
This diff is collapsed.
Click to expand it.
autotest.sh
+
3
−
3
View file @
db710e0b
...
...
@@ -54,7 +54,7 @@ else
fi
if
!
[
-x
"
$PHPUNIT
"
]
;
then
echo
"phpunit executable not found, please install phpunit version >= 4.
4
"
>
&2
echo
"phpunit executable not found, please install phpunit version >= 4.
8
"
>
&2
exit
3
fi
...
...
@@ -69,8 +69,8 @@ PHPUNIT_VERSION=$($PHPUNIT --version | cut -d" " -f2)
PHPUNIT_MAJOR_VERSION
=
$(
echo
"
$PHPUNIT_VERSION
"
|
cut
-d
"."
-f1
)
PHPUNIT_MINOR_VERSION
=
$(
echo
"
$PHPUNIT_VERSION
"
|
cut
-d
"."
-f2
)
if
!
[
"
$PHPUNIT_MAJOR_VERSION
"
-gt
4
-o
\(
"
$PHPUNIT_MAJOR_VERSION
"
-eq
4
-a
"
$PHPUNIT_MINOR_VERSION
"
-ge
4
\)
]
;
then
echo
"phpunit version >= 4.
4
required. Version found:
$PHPUNIT_VERSION
"
>
&2
if
!
[
"
$PHPUNIT_MAJOR_VERSION
"
-gt
4
-o
\(
"
$PHPUNIT_MAJOR_VERSION
"
-eq
4
-a
"
$PHPUNIT_MINOR_VERSION
"
-ge
8
\)
]
;
then
echo
"phpunit version >= 4.
8
required. Version found:
$PHPUNIT_VERSION
"
>
&2
exit
4
fi
...
...
This diff is collapsed.
Click to expand it.
tests/lib/TestCase.php
+
18
−
0
View file @
db710e0b
...
...
@@ -47,6 +47,24 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase {
/** @var array */
protected
$services
=
[];
/**
* Wrapper to be forward compatible to phpunit 5.4+
*
* @param string $originalClassName
* @return \PHPUnit_Framework_MockObject_MockObject
*/
protected
function
createMock
(
$originalClassName
)
{
if
(
is_callable
(
'parent::createMock'
))
{
return
parent
::
createMock
(
$originalClassName
);
}
return
$this
->
getMockBuilder
(
$originalClassName
)
->
disableOriginalConstructor
()
->
disableOriginalClone
()
->
disableArgumentCloning
()
->
getMock
();
}
/**
* @param string $name
* @param mixed $newService
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment