Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
syna
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Thomas Flori
syna
Commits
c968b45c
Unverified
Commit
c968b45c
authored
6 years ago
by
Thomas Flori
Browse files
Options
Downloads
Patches
Plain Diff
throw NotFound exception in factory
parent
3dab365f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Factory.php
+2
-2
2 additions, 2 deletions
src/Factory.php
tests/FactoryTest.php
+3
-2
3 additions, 2 deletions
tests/FactoryTest.php
with
5 additions
and
4 deletions
src/Factory.php
+
2
−
2
View file @
c968b45c
...
...
@@ -116,7 +116,7 @@ class Factory
}
if
(
!
$viewLocator
->
has
(
$name
))
{
throw
new
\Exception
(
'View '
.
$name
.
' not found'
);
throw
new
NotFound
(
'View '
.
$name
.
' not found'
);
}
if
(
is_string
(
$layout
))
{
...
...
@@ -148,7 +148,7 @@ class Factory
return
call_user_func
(
$function
,
...
$arguments
);
}
throw
new
\Exception
(
'$function has to be callable or a registered view helper'
);
throw
new
NotFound
(
'$function has to be callable or a registered view helper'
);
}
/**
...
...
This diff is collapsed.
Click to expand it.
tests/FactoryTest.php
+
3
−
2
View file @
c968b45c
...
...
@@ -5,6 +5,7 @@ namespace Syna\Test;
use
Syna\Factory
;
use
Mockery
as
m
;
use
Syna\HelperLocator
;
use
Syna\NotFound
;
use
Syna\View
;
use
Syna\ViewHelper\CallableHelper
;
use
Syna\ViewLocator
;
...
...
@@ -84,7 +85,7 @@ class FactoryTest extends TestCase
$viewLocator
->
shouldReceive
(
'has'
)
->
with
(
'viewName'
)
->
once
()
->
ordered
()
->
andReturn
(
false
);
self
::
expectException
(
\Exception
::
class
);
self
::
expectException
(
NotFound
::
class
);
self
::
expectExceptionMessage
(
'View viewName not found'
);
$factory
->
view
(
'viewName'
);
...
...
@@ -132,7 +133,7 @@ class FactoryTest extends TestCase
$helperLocator
->
shouldReceive
(
'has'
)
->
with
(
'helperName'
)
->
once
()
->
ordered
()
->
andReturn
(
false
);
self
::
expectException
(
\Exception
::
class
);
self
::
expectException
(
NotFound
::
class
);
self
::
expectExceptionMessage
(
'$function has to be callable or a registered view helper'
);
$factory
->
helper
(
$view
,
'helperName'
,
'argument1'
);
...
...
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