从Play Framework 2.4开始,就有可能使用依赖注入(使用Guice).
AuthenticationService在我的ActionBuilders中使用对象之前(例如):
object AuthenticatedAction extends ActionBuilder[AuthenticatedRequest] {
override def invokeBlock[A](request: Request[A], block: (AuthenticatedRequest[A]) => Future[Result]): Future[Result] = {
...
AuthenticationService.authenticate (...)
...
}
}
Run Code Online (Sandbox Code Playgroud)
现在AuthenticationService不再是一个对象,而是一个类.我怎么还能使用AuthenticationService我的ActionBuilder?
所以我想从我的Testsuite中排除一个directoy就像这样:
<testsuite name="PHPUnitWillKillMe">
<directory>src/*/Bundle/*/*Bundle/Tests</directory>
<exclude>src/*/Bundle/*/*Bundle/Tests/Controller/</exclude>
</testsuite>
Run Code Online (Sandbox Code Playgroud)
应该测试除控制器之外的所有东西.
问题是,它不起作用.当我运行时,PHPUnit仍然在src// Bundle //*Bundle/Tests/Controller /中运行所有测试
phpunit --testsuite PHPUnitWillKillMe
Run Code Online (Sandbox Code Playgroud)
任何的想法?
最好的祝福!
我测试的PHPUnit版本是3.7.21和3.7.28.
当我不关心返回值时,我该如何编写代码.
例:
for {
a <- getA // I do not care about a, but I need to wait for the future to finish
b <- getB
} yield (b)
Run Code Online (Sandbox Code Playgroud) 所以我最近玩React和Flux架构.
假设存在2个存储A和B.A对B具有依赖性,因为它需要来自B的某个值.因此,每当调度程序调度一个动作时,首先执行B.MethodOfB,然后执行A.MethodOfA.
我想知道这个体系结构的优点是什么优于注册A作为B的监听器,并且每次B发出更改事件时只执行A.MethodOfA?
顺便说一句:想想没有来自facebook的示例调度员的"切换案例"的Flux实现!
scala ×2
future ×1
guice ×1
guice-3 ×1
javascript ×1
php ×1
phpunit ×1
reactjs ×1
reactjs-flux ×1
state ×1
unit-testing ×1