Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
Silex
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
Silex
Commits
06d5555f
Commit
06d5555f
authored
Nov 24, 2014
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed CS
parent
1cee7aa8
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
32 additions
and
41 deletions
+32
-41
bin/skeleton/index.php
bin/skeleton/index.php
+1
-1
src/Silex/Application/SecurityTrait.php
src/Silex/Application/SecurityTrait.php
+2
-2
src/Silex/ExceptionListenerWrapper.php
src/Silex/ExceptionListenerWrapper.php
+0
-1
src/Silex/Provider/SecurityServiceProvider.php
src/Silex/Provider/SecurityServiceProvider.php
+1
-1
tests/Silex/Tests/Application/FormTraitTest.php
tests/Silex/Tests/Application/FormTraitTest.php
+0
-1
tests/Silex/Tests/Application/MonologTraitTest.php
tests/Silex/Tests/Application/MonologTraitTest.php
+0
-1
tests/Silex/Tests/Application/SecurityTraitTest.php
tests/Silex/Tests/Application/SecurityTraitTest.php
+0
-1
tests/Silex/Tests/Application/SwiftmailerTraitTest.php
tests/Silex/Tests/Application/SwiftmailerTraitTest.php
+0
-1
tests/Silex/Tests/Application/TranslationTraitTest.php
tests/Silex/Tests/Application/TranslationTraitTest.php
+0
-1
tests/Silex/Tests/Application/TwigTraitTest.php
tests/Silex/Tests/Application/TwigTraitTest.php
+0
-1
tests/Silex/Tests/Application/UrlGeneratorTraitTest.php
tests/Silex/Tests/Application/UrlGeneratorTraitTest.php
+0
-1
tests/Silex/Tests/CallbackResolverTest.php
tests/Silex/Tests/CallbackResolverTest.php
+1
-1
tests/Silex/Tests/CallbackServicesTest.php
tests/Silex/Tests/CallbackServicesTest.php
+0
-0
tests/Silex/Tests/MiddlewareTest.php
tests/Silex/Tests/MiddlewareTest.php
+6
-6
tests/Silex/Tests/Provider/FormServiceProviderTest.php
tests/Silex/Tests/Provider/FormServiceProviderTest.php
+1
-1
tests/Silex/Tests/Provider/SecurityServiceProviderTest.php
tests/Silex/Tests/Provider/SecurityServiceProviderTest.php
+6
-6
tests/Silex/Tests/Provider/SwiftmailerServiceProviderTest.php
...s/Silex/Tests/Provider/SwiftmailerServiceProviderTest.php
+2
-2
tests/Silex/Tests/Provider/TranslationServiceProviderTest.php
...s/Silex/Tests/Provider/TranslationServiceProviderTest.php
+8
-8
tests/Silex/Tests/Provider/ValidatorServiceProviderTest.php
tests/Silex/Tests/Provider/ValidatorServiceProviderTest.php
+2
-3
tests/Silex/Tests/ServiceControllerResolverTest.php
tests/Silex/Tests/ServiceControllerResolverTest.php
+2
-2
No files found.
bin/skeleton/index.php
View file @
06d5555f
...
@@ -4,7 +4,7 @@ require_once __DIR__.'/../vendor/autoload.php';
...
@@ -4,7 +4,7 @@ require_once __DIR__.'/../vendor/autoload.php';
$app
=
new
Silex\Application
();
$app
=
new
Silex\Application
();
$app
->
get
(
'/hello'
,
function
()
{
$app
->
get
(
'/hello'
,
function
()
{
return
'Hello!'
;
return
'Hello!'
;
});
});
...
...
src/Silex/Application/SecurityTrait.php
View file @
06d5555f
...
@@ -31,11 +31,11 @@ trait SecurityTrait
...
@@ -31,11 +31,11 @@ trait SecurityTrait
public
function
user
()
public
function
user
()
{
{
if
(
null
===
$token
=
$this
[
'security'
]
->
getToken
())
{
if
(
null
===
$token
=
$this
[
'security'
]
->
getToken
())
{
return
null
;
return
;
}
}
if
(
!
is_object
(
$user
=
$token
->
getUser
()))
{
if
(
!
is_object
(
$user
=
$token
->
getUser
()))
{
return
null
;
return
;
}
}
return
$user
;
return
$user
;
...
...
src/Silex/ExceptionListenerWrapper.php
View file @
06d5555f
...
@@ -16,7 +16,6 @@ use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
...
@@ -16,7 +16,6 @@ use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
use
Symfony\Component\HttpKernel\KernelEvents
;
use
Symfony\Component\HttpKernel\KernelEvents
;
use
Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent
;
use
Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent
;
use
Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent
;
use
Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent
;
use
Silex\Application
;
/**
/**
* Wraps exception listeners.
* Wraps exception listeners.
...
...
src/Silex/Provider/SecurityServiceProvider.php
View file @
06d5555f
...
@@ -148,7 +148,7 @@ class SecurityServiceProvider implements ServiceProviderInterface
...
@@ -148,7 +148,7 @@ class SecurityServiceProvider implements ServiceProviderInterface
'security.authentication_provider.'
.
$name
.
'.'
.
$provider
,
'security.authentication_provider.'
.
$name
.
'.'
.
$provider
,
'security.authentication_listener.'
.
$name
.
'.'
.
$type
,
'security.authentication_listener.'
.
$name
.
'.'
.
$type
,
$entryPoint
?
'security.entry_point.'
.
$name
.
'.'
.
$entryPoint
:
null
,
$entryPoint
?
'security.entry_point.'
.
$name
.
'.'
.
$entryPoint
:
null
,
$type
$type
,
);
);
});
});
}
}
...
...
tests/Silex/Tests/Application/FormTraitTest.php
View file @
06d5555f
...
@@ -11,7 +11,6 @@
...
@@ -11,7 +11,6 @@
namespace
Silex\Tests\Application
;
namespace
Silex\Tests\Application
;
use
Silex\Application
;
use
Silex\Provider\FormServiceProvider
;
use
Silex\Provider\FormServiceProvider
;
/**
/**
...
...
tests/Silex/Tests/Application/MonologTraitTest.php
View file @
06d5555f
...
@@ -11,7 +11,6 @@
...
@@ -11,7 +11,6 @@
namespace
Silex\Tests\Application
;
namespace
Silex\Tests\Application
;
use
Silex\Application
;
use
Silex\Provider\MonologServiceProvider
;
use
Silex\Provider\MonologServiceProvider
;
use
Monolog\Handler\TestHandler
;
use
Monolog\Handler\TestHandler
;
use
Monolog\Logger
;
use
Monolog\Logger
;
...
...
tests/Silex/Tests/Application/SecurityTraitTest.php
View file @
06d5555f
...
@@ -11,7 +11,6 @@
...
@@ -11,7 +11,6 @@
namespace
Silex\Tests\Application
;
namespace
Silex\Tests\Application
;
use
Silex\Application
;
use
Silex\Provider\SecurityServiceProvider
;
use
Silex\Provider\SecurityServiceProvider
;
use
Symfony\Component\Security\Core\User\User
;
use
Symfony\Component\Security\Core\User\User
;
use
Symfony\Component\HttpFoundation\Request
;
use
Symfony\Component\HttpFoundation\Request
;
...
...
tests/Silex/Tests/Application/SwiftmailerTraitTest.php
View file @
06d5555f
...
@@ -11,7 +11,6 @@
...
@@ -11,7 +11,6 @@
namespace
Silex\Tests\Application
;
namespace
Silex\Tests\Application
;
use
Silex\Application
;
use
Silex\Provider\SwiftmailerServiceProvider
;
use
Silex\Provider\SwiftmailerServiceProvider
;
/**
/**
...
...
tests/Silex/Tests/Application/TranslationTraitTest.php
View file @
06d5555f
...
@@ -11,7 +11,6 @@
...
@@ -11,7 +11,6 @@
namespace
Silex\Tests\Application
;
namespace
Silex\Tests\Application
;
use
Silex\Application
;
use
Silex\Provider\TranslationServiceProvider
;
use
Silex\Provider\TranslationServiceProvider
;
/**
/**
...
...
tests/Silex/Tests/Application/TwigTraitTest.php
View file @
06d5555f
...
@@ -11,7 +11,6 @@
...
@@ -11,7 +11,6 @@
namespace
Silex\Tests\Application
;
namespace
Silex\Tests\Application
;
use
Silex\Application
;
use
Silex\Provider\TwigServiceProvider
;
use
Silex\Provider\TwigServiceProvider
;
use
Symfony\Component\HttpFoundation\Response
;
use
Symfony\Component\HttpFoundation\Response
;
use
Symfony\Component\HttpFoundation\StreamedResponse
;
use
Symfony\Component\HttpFoundation\StreamedResponse
;
...
...
tests/Silex/Tests/Application/UrlGeneratorTraitTest.php
View file @
06d5555f
...
@@ -11,7 +11,6 @@
...
@@ -11,7 +11,6 @@
namespace
Silex\Tests\Application
;
namespace
Silex\Tests\Application
;
use
Silex\Application
;
use
Silex\Provider\UrlGeneratorServiceProvider
;
use
Silex\Provider\UrlGeneratorServiceProvider
;
/**
/**
...
...
tests/Silex/Tests/CallbackResolverTest.php
View file @
06d5555f
...
@@ -23,7 +23,7 @@ class CallbackResolverTest extends \PHPUnit_Framework_Testcase
...
@@ -23,7 +23,7 @@ class CallbackResolverTest extends \PHPUnit_Framework_Testcase
public
function
testShouldResolveCallback
()
public
function
testShouldResolveCallback
()
{
{
$this
->
app
[
'some_service'
]
=
function
()
{
return
new
\stdClass
();
};
$this
->
app
[
'some_service'
]
=
function
()
{
return
new
\stdClass
();
};
$this
->
assertTrue
(
$this
->
resolver
->
isValid
(
'some_service:methodName'
));
$this
->
assertTrue
(
$this
->
resolver
->
isValid
(
'some_service:methodName'
));
$this
->
assertEquals
(
$this
->
assertEquals
(
...
...
tests/Silex/Tests/CallbackServicesTest
s
.php
→
tests/Silex/Tests/CallbackServicesTest.php
View file @
06d5555f
File moved
tests/Silex/Tests/MiddlewareTest.php
View file @
06d5555f
...
@@ -168,9 +168,9 @@ class MiddlewareTest extends \PHPUnit_Framework_TestCase
...
@@ -168,9 +168,9 @@ class MiddlewareTest extends \PHPUnit_Framework_TestCase
$app
->
before
(
function
()
{
return
new
Response
(
'app before'
);
});
$app
->
before
(
function
()
{
return
new
Response
(
'app before'
);
});
$app
->
get
(
'/'
,
function
()
{
$app
->
get
(
'/'
,
function
()
{
return
new
Response
(
'test'
);
return
new
Response
(
'test'
);
})
->
before
(
function
()
{
})
->
before
(
function
()
{
return
new
Response
(
'middleware before'
);
return
new
Response
(
'middleware before'
);
});
});
...
@@ -247,14 +247,14 @@ class MiddlewareTest extends \PHPUnit_Framework_TestCase
...
@@ -247,14 +247,14 @@ class MiddlewareTest extends \PHPUnit_Framework_TestCase
$middlewareTarget
[]
=
'application_before_middleware_triggered'
;
$middlewareTarget
[]
=
'application_before_middleware_triggered'
;
};
};
$applicationAfterMiddleware
=
function
(
$request
,
$response
,
$app
)
use
(
&
$middlewareTarget
,
$test
){
$applicationAfterMiddleware
=
function
(
$request
,
$response
,
$app
)
use
(
&
$middlewareTarget
,
$test
)
{
$test
->
assertInstanceOf
(
'\Symfony\Component\HttpFoundation\Request'
,
$request
);
$test
->
assertInstanceOf
(
'\Symfony\Component\HttpFoundation\Request'
,
$request
);
$test
->
assertInstanceOf
(
'\Symfony\Component\HttpFoundation\Response'
,
$response
);
$test
->
assertInstanceOf
(
'\Symfony\Component\HttpFoundation\Response'
,
$response
);
$test
->
assertInstanceOf
(
'\Silex\Application'
,
$app
);
$test
->
assertInstanceOf
(
'\Silex\Application'
,
$app
);
$middlewareTarget
[]
=
'application_after_middleware_triggered'
;
$middlewareTarget
[]
=
'application_after_middleware_triggered'
;
};
};
$applicationFinishMiddleware
=
function
(
$request
,
$response
,
$app
)
use
(
&
$middlewareTarget
,
$test
){
$applicationFinishMiddleware
=
function
(
$request
,
$response
,
$app
)
use
(
&
$middlewareTarget
,
$test
)
{
$test
->
assertInstanceOf
(
'\Symfony\Component\HttpFoundation\Request'
,
$request
);
$test
->
assertInstanceOf
(
'\Symfony\Component\HttpFoundation\Request'
,
$request
);
$test
->
assertInstanceOf
(
'\Symfony\Component\HttpFoundation\Response'
,
$response
);
$test
->
assertInstanceOf
(
'\Symfony\Component\HttpFoundation\Response'
,
$response
);
$test
->
assertInstanceOf
(
'\Silex\Application'
,
$app
);
$test
->
assertInstanceOf
(
'\Silex\Application'
,
$app
);
...
@@ -267,7 +267,7 @@ class MiddlewareTest extends \PHPUnit_Framework_TestCase
...
@@ -267,7 +267,7 @@ class MiddlewareTest extends \PHPUnit_Framework_TestCase
$middlewareTarget
[]
=
'route_before_middleware_triggered'
;
$middlewareTarget
[]
=
'route_before_middleware_triggered'
;
};
};
$routeAfterMiddleware
=
function
(
$request
,
$response
,
$app
)
use
(
&
$middlewareTarget
,
$test
){
$routeAfterMiddleware
=
function
(
$request
,
$response
,
$app
)
use
(
&
$middlewareTarget
,
$test
)
{
$test
->
assertInstanceOf
(
'\Symfony\Component\HttpFoundation\Request'
,
$request
);
$test
->
assertInstanceOf
(
'\Symfony\Component\HttpFoundation\Request'
,
$request
);
$test
->
assertInstanceOf
(
'\Symfony\Component\HttpFoundation\Response'
,
$response
);
$test
->
assertInstanceOf
(
'\Symfony\Component\HttpFoundation\Response'
,
$response
);
$test
->
assertInstanceOf
(
'\Silex\Application'
,
$app
);
$test
->
assertInstanceOf
(
'\Silex\Application'
,
$app
);
...
@@ -290,4 +290,4 @@ class MiddlewareTest extends \PHPUnit_Framework_TestCase
...
@@ -290,4 +290,4 @@ class MiddlewareTest extends \PHPUnit_Framework_TestCase
$this
->
assertSame
(
array
(
'application_before_middleware_triggered'
,
'route_before_middleware_triggered'
,
'route_after_middleware_triggered'
,
'application_after_middleware_triggered'
,
'application_finish_middleware_triggered'
),
$middlewareTarget
);
$this
->
assertSame
(
array
(
'application_before_middleware_triggered'
,
'route_before_middleware_triggered'
,
'route_after_middleware_triggered'
,
'application_after_middleware_triggered'
,
'application_finish_middleware_triggered'
),
$middlewareTarget
);
}
}
}
}
\ No newline at end of file
tests/Silex/Tests/Provider/FormServiceProviderTest.php
View file @
06d5555f
...
@@ -91,7 +91,7 @@ class FormServiceProviderTest extends \PHPUnit_Framework_TestCase
...
@@ -91,7 +91,7 @@ class FormServiceProviderTest extends \PHPUnit_Framework_TestCase
$app
->
register
(
new
TranslationServiceProvider
());
$app
->
register
(
new
TranslationServiceProvider
());
$app
[
'translator.domains'
]
=
array
(
$app
[
'translator.domains'
]
=
array
(
'messages'
=>
array
(
'messages'
=>
array
(
'de'
=>
array
(
'de'
=>
array
(
'The CSRF token is invalid. Please try to resubmit the form.'
=>
'German translation'
,
'The CSRF token is invalid. Please try to resubmit the form.'
=>
'German translation'
,
),
),
),
),
...
...
tests/Silex/Tests/Provider/SecurityServiceProviderTest.php
View file @
06d5555f
...
@@ -131,7 +131,7 @@ class SecurityServiceProviderTest extends WebTestCase
...
@@ -131,7 +131,7 @@ class SecurityServiceProviderTest extends WebTestCase
'http'
=>
true
,
'http'
=>
true
,
'users'
=>
array
(
'users'
=>
array
(
'admin'
=>
array
(
'ROLE_ADMIN'
,
'513aeb0121909'
),
'admin'
=>
array
(
'ROLE_ADMIN'
,
'513aeb0121909'
),
)
)
,
),
),
),
),
));
));
...
@@ -217,13 +217,13 @@ class SecurityServiceProviderTest extends WebTestCase
...
@@ -217,13 +217,13 @@ class SecurityServiceProviderTest extends WebTestCase
),
),
));
));
$app
->
get
(
'/login'
,
function
(
Request
$request
)
use
(
$app
)
{
$app
->
get
(
'/login'
,
function
(
Request
$request
)
use
(
$app
)
{
$app
[
'session'
]
->
start
();
$app
[
'session'
]
->
start
();
return
$app
[
'security.last_error'
](
$request
);
return
$app
[
'security.last_error'
](
$request
);
});
});
$app
->
get
(
'/'
,
function
()
use
(
$app
)
{
$app
->
get
(
'/'
,
function
()
use
(
$app
)
{
$user
=
$app
[
'security'
]
->
getToken
()
->
getUser
();
$user
=
$app
[
'security'
]
->
getToken
()
->
getUser
();
$content
=
is_object
(
$user
)
?
$user
->
getUsername
()
:
'ANONYMOUS'
;
$content
=
is_object
(
$user
)
?
$user
->
getUsername
()
:
'ANONYMOUS'
;
...
@@ -239,7 +239,7 @@ class SecurityServiceProviderTest extends WebTestCase
...
@@ -239,7 +239,7 @@ class SecurityServiceProviderTest extends WebTestCase
return
$content
;
return
$content
;
});
});
$app
->
get
(
'/admin'
,
function
()
use
(
$app
)
{
$app
->
get
(
'/admin'
,
function
()
use
(
$app
)
{
return
'admin'
;
return
'admin'
;
});
});
...
@@ -268,7 +268,7 @@ class SecurityServiceProviderTest extends WebTestCase
...
@@ -268,7 +268,7 @@ class SecurityServiceProviderTest extends WebTestCase
),
),
));
));
$app
->
get
(
'/'
,
function
()
use
(
$app
)
{
$app
->
get
(
'/'
,
function
()
use
(
$app
)
{
$user
=
$app
[
'security'
]
->
getToken
()
->
getUser
();
$user
=
$app
[
'security'
]
->
getToken
()
->
getUser
();
$content
=
is_object
(
$user
)
?
$user
->
getUsername
()
:
'ANONYMOUS'
;
$content
=
is_object
(
$user
)
?
$user
->
getUsername
()
:
'ANONYMOUS'
;
...
@@ -284,7 +284,7 @@ class SecurityServiceProviderTest extends WebTestCase
...
@@ -284,7 +284,7 @@ class SecurityServiceProviderTest extends WebTestCase
return
$content
;
return
$content
;
});
});
$app
->
get
(
'/admin'
,
function
()
use
(
$app
)
{
$app
->
get
(
'/admin'
,
function
()
use
(
$app
)
{
return
'admin'
;
return
'admin'
;
});
});
...
...
tests/Silex/Tests/Provider/SwiftmailerServiceProviderTest.php
View file @
06d5555f
...
@@ -38,7 +38,7 @@ class SwiftmailerServiceProviderTest extends \PHPUnit_Framework_TestCase
...
@@ -38,7 +38,7 @@ class SwiftmailerServiceProviderTest extends \PHPUnit_Framework_TestCase
return
new
SpoolStub
();
return
new
SpoolStub
();
});
});
$app
->
get
(
'/'
,
function
()
use
(
$app
)
{
$app
->
get
(
'/'
,
function
()
use
(
$app
)
{
$app
[
'mailer'
]
->
send
(
\Swift_Message
::
newInstance
());
$app
[
'mailer'
]
->
send
(
\Swift_Message
::
newInstance
());
});
});
...
@@ -64,7 +64,7 @@ class SwiftmailerServiceProviderTest extends \PHPUnit_Framework_TestCase
...
@@ -64,7 +64,7 @@ class SwiftmailerServiceProviderTest extends \PHPUnit_Framework_TestCase
return
new
SpoolStub
();
return
new
SpoolStub
();
});
});
$app
->
get
(
'/'
,
function
()
use
(
$app
)
{
});
$app
->
get
(
'/'
,
function
()
use
(
$app
)
{
});
$request
=
Request
::
create
(
'/'
);
$request
=
Request
::
create
(
'/'
);
$response
=
$app
->
handle
(
$request
);
$response
=
$app
->
handle
(
$request
);
...
...
tests/Silex/Tests/Provider/TranslationServiceProviderTest.php
View file @
06d5555f
...
@@ -31,22 +31,22 @@ class TranslationServiceProviderTest extends \PHPUnit_Framework_TestCase
...
@@ -31,22 +31,22 @@ class TranslationServiceProviderTest extends \PHPUnit_Framework_TestCase
$app
->
register
(
new
TranslationServiceProvider
());
$app
->
register
(
new
TranslationServiceProvider
());
$app
[
'translator.domains'
]
=
array
(
$app
[
'translator.domains'
]
=
array
(
'messages'
=>
array
(
'messages'
=>
array
(
'en'
=>
array
(
'en'
=>
array
(
'key1'
=>
'The translation'
,
'key1'
=>
'The translation'
,
'key_only_english'
=>
'Foo'
,
'key_only_english'
=>
'Foo'
,
'key2'
=>
'One apple|%count% apples'
,
'key2'
=>
'One apple|%count% apples'
,
'test'
=>
array
(
'test'
=>
array
(
'key'
=>
'It works'
'key'
=>
'It works'
,
)
)
,
),
),
'de'
=>
array
(
'de'
=>
array
(
'key1'
=>
'The german translation'
,
'key1'
=>
'The german translation'
,
'key2'
=>
'One german apple|%count% german apples'
,
'key2'
=>
'One german apple|%count% german apples'
,
'test'
=>
array
(
'test'
=>
array
(
'key'
=>
'It works in german'
'key'
=>
'It works in german'
,
)
)
,
)
)
,
)
)
,
);
);
return
$app
;
return
$app
;
...
...
tests/Silex/Tests/Provider/ValidatorServiceProviderTest.php
View file @
06d5555f
...
@@ -38,14 +38,14 @@ class ValidatorServiceProviderTest extends \PHPUnit_Framework_TestCase
...
@@ -38,14 +38,14 @@ class ValidatorServiceProviderTest extends \PHPUnit_Framework_TestCase
{
{
$app
=
new
Application
();
$app
=
new
Application
();
$app
[
'custom.validator'
]
=
$app
->
share
(
function
()
{
$app
[
'custom.validator'
]
=
$app
->
share
(
function
()
{
return
new
CustomValidator
();
return
new
CustomValidator
();
});
});
$app
->
register
(
new
ValidatorServiceProvider
(),
array
(
$app
->
register
(
new
ValidatorServiceProvider
(),
array
(
'validator.validator_service_ids'
=>
array
(
'validator.validator_service_ids'
=>
array
(
'test.custom.validator'
=>
'custom.validator'
,
'test.custom.validator'
=>
'custom.validator'
,
)
)
,
));
));
return
$app
;
return
$app
;
...
@@ -112,5 +112,4 @@ class ValidatorServiceProviderTest extends \PHPUnit_Framework_TestCase
...
@@ -112,5 +112,4 @@ class ValidatorServiceProviderTest extends \PHPUnit_Framework_TestCase
array
(
'email@sample.com'
,
true
,
0
,
0
),
array
(
'email@sample.com'
,
true
,
0
,
0
),
);
);
}
}
}
}
tests/Silex/Tests/ServiceControllerResolverTest.php
View file @
06d5555f
...
@@ -45,7 +45,7 @@ class ServiceControllerResolverTest extends \PHPUnit_Framework_Testcase
...
@@ -45,7 +45,7 @@ class ServiceControllerResolverTest extends \PHPUnit_Framework_Testcase
->
with
(
'some_service:methodName'
)
->
with
(
'some_service:methodName'
)
->
will
(
$this
->
returnValue
(
array
(
'callback'
)));
->
will
(
$this
->
returnValue
(
array
(
'callback'
)));
$this
->
app
[
'some_service'
]
=
function
()
{
return
new
\stdClass
();
};
$this
->
app
[
'some_service'
]
=
function
()
{
return
new
\stdClass
();
};
$req
=
Request
::
create
(
'/'
);
$req
=
Request
::
create
(
'/'
);
$req
->
attributes
->
set
(
'_controller'
,
'some_service:methodName'
);
$req
->
attributes
->
set
(
'_controller'
,
'some_service:methodName'
);
...
@@ -79,6 +79,6 @@ class ServiceControllerResolverTest extends \PHPUnit_Framework_Testcase
...
@@ -79,6 +79,6 @@ class ServiceControllerResolverTest extends \PHPUnit_Framework_Testcase
->
with
(
$req
)
->
with
(
$req
)
->
will
(
$this
->
returnValue
(
123
));
->
will
(
$this
->
returnValue
(
123
));
$this
->
assertEquals
(
123
,
$this
->
resolver
->
getArguments
(
$req
,
function
()
{}));
$this
->
assertEquals
(
123
,
$this
->
resolver
->
getArguments
(
$req
,
function
()
{}));
}
}
}
}
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