Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wp-view
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wpdesk
wp-view
Merge requests
!3
Feature/implementation
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
Feature/implementation
feature/implementation
into
master
Overview
0
Commits
13
Pipelines
1
Changes
1
Merged
Krzysztof Dyszczyk
requested to merge
feature/implementation
into
master
6 years ago
Overview
0
Commits
13
Pipelines
1
Changes
1
0
0
Merge request reports
Viewing commit
24aae866
Prev
Next
Show latest version
1 file
+
29
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
24aae866
tests for dir resolver
· 24aae866
dyszczo
authored
6 years ago
tests/unit/Resolver/TestDirResolver.php
0 → 100644
+
29
−
0
View file @ 24aae866
Edit in single-file editor
Open in Web IDE
<?php
use
WPDesk\View\Resolver\Exception\CanNotResolve
;
class
TestDirResolver
extends
\PHPUnit\Framework\TestCase
{
const
TEMPLATE_NAME
=
'some_template'
;
const
TEMPLATE_FILE
=
'some_template.php'
;
const
TEMPLATE_SUBDIR
=
'templates'
;
public
function
testCanFindInDirPath
()
{
$dir
=
__DIR__
.
'/'
.
self
::
TEMPLATE_SUBDIR
;
$resolver
=
new
\WPDesk\View\Resolver\DirResolver
(
$dir
);
$this
->
assertStringEndsWith
(
self
::
TEMPLATE_FILE
,
$resolver
->
resolve
(
self
::
TEMPLATE_NAME
),
'Template should be found in dir'
);
}
public
function
testThrowExceptionWhenCannotFind
()
{
$this
->
expectException
(
CanNotResolve
::
class
);
$resolver
=
new
\WPDesk\View\Resolver\DirResolver
(
'whatever'
);
$resolver
->
resolve
(
'whatever2'
);
}
}
\ No newline at end of file
Loading