Skip to content
Next
Projects
Groups
Snippets
Help
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
290
Merge Requests
40
CI / CD
Security & Compliance
Packages
Wiki
Snippets
Members
Collapse sidebar
Close sidebar
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Backend - Engine
Commits
2a395c1d
Commit
2a395c1d
authored
10 minutes ago
by
Marcelo Rivera
Browse files
Options
Download
(fix): spec tests
parent
24d1a927
fix/remove-public-asset-signing
1 merge request
!388
Remove asset signing for public posts
Pipeline
#93544048
failed with stages
in 4 minutes and 59 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
3 deletions
+41
-3
Spec/Core/Media/Video/ManagerSpec.php
View file @
2a395c1d
...
...
@@ -27,7 +27,7 @@ class ManagerSpec extends ObjectBehavior
$this
->
shouldHaveType
(
Manager
::
class
);
}
public
function
it_should_get_a_
720p_video
(
RequestInterface
$request
,
\Aws\CommandInterface
$cmd
)
public
function
it_should_get_a_
signed_720p_video_url
(
RequestInterface
$request
,
\Aws\CommandInterface
$cmd
)
{
$this
->
config
->
get
(
'transcoder'
)
->
willReturn
([
...
...
@@ -39,22 +39,60 @@ class ManagerSpec extends ObjectBehavior
'useRoles'
=>
true
,
]);
$this
->
config
->
get
(
'cinemr_url'
)
->
willReturn
(
'https://url.com/cinemr'
);
$this
->
s3
->
getCommand
(
'GetObject'
,
[
'Bucket'
=>
'cinemr'
,
'Key'
=>
'dir/123/720.mp4'
])
->
shouldBeCalled
()
->
willReturn
(
$cmd
);
$request
->
getUri
()
->
willReturn
(
's3-signed-url-here'
);
$this
->
s3
->
createPresignedRequest
(
Argument
::
any
(),
Argument
::
any
())
->
willReturn
(
$request
);
$video
=
new
Video
();
$video
->
set
(
'cinemr_guid'
,
123
);
$video
->
set
(
'access_id'
,
ACCESS_PRIVATE
);
$this
->
getPublicAssetUri
(
$video
,
'720.mp4'
)
->
shouldBe
(
's3-signed-url-here'
);
}
public
function
it_should_get_an_unsigned_720p_video_url
(
RequestInterface
$request
,
\Aws\CommandInterface
$cmd
)
{
$this
->
config
->
get
(
'transcoder'
)
->
willReturn
([
'dir'
=>
'dir'
,
]);
$this
->
config
->
get
(
'aws'
)
->
willReturn
([
'region'
=>
'us-east-1'
,
'useRoles'
=>
true
,
]);
$this
->
config
->
get
(
'cinemr_url'
)
->
willReturn
(
'https://url.com/cinemr'
);
$this
->
s3
->
getCommand
(
'GetObject'
,
[
'Bucket'
=>
'cinemr'
,
'Key'
=>
'dir/123/720.mp4'
])
->
shouldBeCalled
()
->
willReturn
(
$cmd
);
$request
->
getUri
()
->
willReturn
(
's3-signed-url-here'
);
$this
->
s3
->
createPresignedRequest
(
Argument
::
any
(),
Argument
::
any
())
->
willReturn
(
$request
);
$video
=
new
Video
();
$video
->
set
(
'cinemr_guid'
,
123
);
$this
->
getPublicAssetUri
(
$video
,
'720.mp4'
)
->
shouldBe
(
'https://url.com/cinemr123/720.mp4'
);
}
}
This diff is collapsed.
Please
register
or
sign in
to comment