Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project
Project
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
242
Issues
242
List
Boards
Labels
Service Desk
Milestones
Merge Requests
34
Merge Requests
34
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Backend - Engine
Commits
06925ad7
Commit
06925ad7
authored
4 hours ago
by
Emiliano Balbuena
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(test): pro spec tests
parent
20ec8968
epic/minds-pro
1 merge request
!308
WIP: (feat): Minds Pro
Pipeline
#81442706
failed with stages
in 4 minutes and 13 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
164 additions
and
3 deletions
+164
-3
Domain.php
Core/Pro/Domain.php
+5
-3
DomainSpec.php
Spec/Core/Pro/DomainSpec.php
+74
-0
SettingsSpec.php
Spec/Core/Pro/SettingsSpec.php
+85
-0
No files found.
Core/Pro/Domain.php
View file @
06925ad7
...
...
@@ -62,10 +62,12 @@ class Domain
* @return string
* @throws Exception
*/
public
function
getIcon
(
Settings
$settings
)
public
function
getIcon
(
Settings
$settings
,
User
$owner
=
null
)
{
$owner
=
new
User
();
$owner
->
guid
=
$settings
->
getUserGuid
();
if
(
!
$owner
)
{
$owner
=
new
User
();
$owner
->
guid
=
$settings
->
getUserGuid
();
}
return
$owner
->
getIconURL
(
'large'
);
}
...
...
This diff is collapsed.
Click to expand it.
Spec/Core/Pro/DomainSpec.php
0 → 100644
View file @
06925ad7
<?php
namespace
Spec\Minds\Core\Pro
;
use
Minds\Common\Repository\Response
;
use
Minds\Core\Config
;
use
Minds\Core\Pro\Domain
;
use
Minds\Core\Pro\Repository
;
use
Minds\Core\Pro\Settings
;
use
Minds\Entities\User
;
use
PhpSpec\ObjectBehavior
;
use
Prophecy\Argument
;
class
DomainSpec
extends
ObjectBehavior
{
/** @var Config */
protected
$config
;
/** @var Repository */
protected
$repository
;
function
let
(
Config
$config
,
Repository
$repository
)
{
$this
->
config
=
$config
;
$this
->
repository
=
$repository
;
$this
->
beConstructedWith
(
$config
,
$repository
);
}
function
it_is_initializable
()
{
$this
->
shouldHaveType
(
Domain
::
class
);
}
function
it_should_lookup_for_a_domain
(
Response
$repositoryResponse
,
Settings
$settings
)
{
$this
->
config
->
get
(
'root_domains'
)
->
shouldBeCalled
()
->
willReturn
([
'minds.com'
]);
$this
->
repository
->
getList
([
'domain'
=>
'minds.test'
,
])
->
shouldBeCalled
()
->
willReturn
(
$repositoryResponse
);
$repositoryResponse
->
first
()
->
shouldBeCalled
()
->
willReturn
(
$settings
);
$this
->
lookup
(
'minds.test'
)
->
shouldReturn
(
$settings
);
}
function
it_should_get_an_icon
(
Settings
$settings
,
User
$user
)
{
$user
->
getIconURL
(
'large'
)
->
shouldBeCalled
()
->
willReturn
(
'/1000/large'
);
$this
->
getIcon
(
$settings
,
$user
)
->
shouldReturn
(
'/1000/large'
);
}
}
This diff is collapsed.
Click to expand it.
Spec/Core/Pro/SettingsSpec.php
0 → 100644
View file @
06925ad7
<?php
namespace
Spec\Minds\Core\Pro
;
use
Minds\Core\Pro\Settings
;
use
PhpSpec\ObjectBehavior
;
use
Prophecy\Argument
;
class
SettingsSpec
extends
ObjectBehavior
{
function
it_is_initializable
()
{
$this
->
shouldHaveType
(
Settings
::
class
);
}
function
it_should_get_one_line_headline_from_single_line_value
()
{
$this
->
setHeadline
(
'This is a headline'
);
$this
->
getOneLineHeadline
()
->
shouldReturn
(
'This is a headline'
);
}
function
it_should_get_one_line_headline_from_multi_line_value
()
{
$this
->
setHeadline
(
"This is a headline.
\n
Other line"
);
$this
->
getOneLineHeadline
()
->
shouldReturn
(
'This is a headline. Other line'
);
}
function
it_should_export
()
{
$this
->
export
()
->
shouldBeArray
();
}
function
it_should_build_styles
()
{
$this
->
buildStyles
()
->
shouldBeArray
();
}
function
it_should_calc_tile_ratio_percentage
()
{
$this
->
setTileRatio
(
'1:1'
);
$this
->
calcTileRatioPercentage
()
->
shouldReturn
(
100.0
);
$this
->
setTileRatio
(
'4:3'
);
$this
->
calcTileRatioPercentage
()
->
shouldReturn
(
75.0
);
$this
->
setTileRatio
(
'16:10'
);
$this
->
calcTileRatioPercentage
()
->
shouldReturn
(
62.5
);
$this
->
setTileRatio
(
'16:9'
);
$this
->
calcTileRatioPercentage
()
->
shouldReturn
(
56.25
);
$this
->
setTileRatio
(
''
);
$this
->
calcTileRatioPercentage
()
->
shouldReturn
(
56.25
);
}
}
This diff is collapsed.
Click to expand it.
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