Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
services
T
t3o sites
extensions.typo3.org
extensions.typo3.org
Commits
ef3893d7
Commit
ef3893d7
authored
Nov 26, 2020
by
Thomas Löffler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix unit tests with downloadRepository
parent
73e1cb51
Pipeline
#10070
failed with stages
in 3 minutes and 42 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
2 deletions
+31
-2
extensions/ter_fe2/Tests/Unit/Domain/Model/ExtensionTest.php
extensions/ter_fe2/Tests/Unit/Domain/Model/ExtensionTest.php
+31
-2
No files found.
extensions/ter_fe2/Tests/Unit/Domain/Model/ExtensionTest.php
View file @
ef3893d7
...
@@ -233,11 +233,27 @@ class ExtensionTest extends \Nimut\TestingFramework\TestCase\UnitTestCase
...
@@ -233,11 +233,27 @@ class ExtensionTest extends \Nimut\TestingFramework\TestCase\UnitTestCase
*/
*/
public
function
addVersionCheckDownloadCounter
()
public
function
addVersionCheckDownloadCounter
()
{
{
$extension
=
new
Extension
();
$extension
=
$this
->
getAccessibleMock
(
Extension
::
class
,
[
'dummy'
]
);
$version
=
new
Version
();
$version
=
new
Version
();
$version
->
setDownloadCounter
(
12345
);
$version
->
setDownloadCounter
(
12345
);
$extension
->
addVersion
(
$version
);
$extension
->
addVersion
(
$version
);
$downloadRepository
=
$this
->
getAccessibleMock
(
\
T3o\TerFe2\Domain\Repository\DownloadRepository
::
class
,
[
'findDownloadsByExtensionkey'
],
[],
''
,
false
);
$extension
->
_set
(
'downloadRepository'
,
$downloadRepository
);
$downloadRepository
->
expects
(
self
::
once
())
->
method
(
'findDownloadsByExtensionkey'
)
->
with
(
$extension
->
getExtKey
())
->
willReturn
(
0
);
self
::
assertEquals
(
self
::
assertEquals
(
12345
,
12345
,
$extension
->
getDownloads
()
$extension
->
getDownloads
()
...
@@ -310,10 +326,23 @@ class ExtensionTest extends \Nimut\TestingFramework\TestCase\UnitTestCase
...
@@ -310,10 +326,23 @@ class ExtensionTest extends \Nimut\TestingFramework\TestCase\UnitTestCase
*/
*/
public
function
addDownloads
()
public
function
addDownloads
()
{
{
$extension
=
new
Extension
(
);
$extension
=
$this
->
getAccessibleMock
(
Extension
::
class
,
[
'dummy'
]
);
$extension
->
setDownloads
(
1000
);
$extension
->
setDownloads
(
1000
);
$extension
->
addDownloads
(
2000
);
$extension
->
addDownloads
(
2000
);
$downloadRepository
=
$this
->
getAccessibleMock
(
\
T3o\TerFe2\Domain\Repository\DownloadRepository
::
class
,
[
'findDownloadsByExtensionkey'
],
[],
''
,
false
);
$extension
->
_set
(
'downloadRepository'
,
$downloadRepository
);
$downloadRepository
->
expects
(
self
::
once
())
->
method
(
'findDownloadsByExtensionkey'
)
->
with
(
$extension
->
getExtKey
())
->
willReturn
(
0
);
self
::
assertEquals
(
self
::
assertEquals
(
3000
,
3000
,
$extension
->
getDownloads
()
$extension
->
getDownloads
()
...
...
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