PHPSpec - 无法运行,有人使用它进行 php 开发吗?
搜索了 stackoverflow 并没有找到答案
来自 Ruby On Rails 和 Rspec,我需要像 rspec 这样的工具(更容易过渡)。 通过 PEAR 安装它并尝试运行它,但它还不起作用
只是想问问周围是否有人使用它有同样的问题,因为它根本没有运行
尝试使用手册中的示例运行它 - http://dev.phpspec.org/manual /en/before.writing.code.specify.its.required.behaviour.html
phpspec NewFileSystemLoggerSpec
返回
即使运行也不
phpspec some_dummy_value
任何内容
Searched stackoverflow for this and found no answer
Coming from Ruby On Rails and Rspec, I need a tool like rspec (easier transition). Installed it through PEAR and tried to run it but it's not working (yet)
Just wanna ask around if anyone's using it have the same problem, since it's not running at all
tried running it with an example from the manual - http://dev.phpspec.org/manual/en/before.writing.code.specify.its.required.behaviour.html
phpspec NewFileSystemLoggerSpec
returns nothing
even running
phpspec some_dummy_value
returns nothing
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
PHPSpec 的开发在中断 2 年之后于 2010 年 8 月重新开始。 代码库现在看起来更加稳定。 我会再尝试一次。
该网站现在位于 www.phpspec.net
您可以在 http://www.phpspec.net/ 找到文档文档。 它基本上是第一个版本的更新。
如果您需要任何进一步的帮助,您还可以通过他们的邮件列表联系开发人员:
http://groups.google.com/group/phpspec-dev
Development on PHPSpec has restarted since August 2010, after a 2 years break. The code base looks more stable now. I would give another try.
The website is now located at www.phpspec.net
You can find the documentation at http://www.phpspec.net/documentation. It is basically an update of the first version.
Should you require any further assistance you can also reach the developers through their mailing list:
http://groups.google.com/group/phpspec-dev
我也无法让它运行,但您也可以将 BDD 与 PHPUnit 结合使用。 查看文档:
I also couldn't get it to run, but you can also use BDD with PHPUnit. Check the documentation:
真的很期待使用 PHPSpec,哦我想会检查 PHPUnit
Was really looking forward to using PHPSpec, oh I guess will check into PHPUnit
我尝试使用 phpspec 但发现它太多错误/不成熟。 我强烈推荐 SimpleTest 来编写单元测试。
I tried using phpspec but found it too buggy/immature. I can highly recommend SimpleTest for writing unittests.
您可以在 PHPUnit 中编写 RSpec 类型的测试,但它受到一些因素的阻碍。
PHPUnit 模拟不允许你
重新声明它们,因此很难设置
之前的一堆存根
方法,然后将它们重写为
需要。 您可以通过以下方式解决此问题
安排存根的设置
超出了预期,但这很奇怪。
PHP 不像 Ruby 那样动态,所以你
不能轻易模拟或存根类
方法除非你特别
为此设计课程,甚至
那么它就很难看了。 (这可能
随着 PHP 5.3 的后期静态变化
绑定功能)。
You can write RSpec-ish types of tests in PHPUnit, but it's hindered by a couple of things.
PHPUnit mocks don't let you
re-declare them so it's hard to set
up a bunch of stubs in a before
method and then override them as
needed. You can work around this by
arranging for the stubs to be setup
after the expectations, but it's odd.
PHP isn't as dynamic as Ruby so you
can't easily mock or stub out class
methods unless you specifically
design the class for this and even
then it's pretty ugly. (This may
change with PHP 5.3's late static
binding features).
我已经成功使用了 PHPSpec,但现在它还没有积极开发,是吗? 这很棒,但我不认为我会接受一个停滞的项目。 无论如何,我使用以下设置从网络浏览器运行测试,也许您会找到一些东西来帮助您为 CLI 设置它。
PHPSpecConfiguration.php
以及运行它的文件:AllSpecs.php;
我不喜欢 CLI 测试...但这可能对某人有帮助。
I have used PHPSpec succesfully but it's not actively developed now is it? It's great but don't think I would go with a stalled project. Anyway to the point I used the following setup to run the tests from the webbrowser, maybe you'll find something to help you to set it up for CLI.
PHPSpecConfiguration.php
and then the file that runs it all: AllSpecs.php;
I don't like CLI testing...But this might help someone.
你好,它确实是一个相当老的问题,但我认为 http://behat.org/ 应该在这里。 每个人都有这个问题,应该检查一下。
Hello its pretty old Q. in deed, but i think http://behat.org/ should be here. Everyone has this problem should check it out.
请注意,PHPSpec 已停止使用:
http://blog.astrumfutura.com/2010/05/the-mockery-php-mock-objects-made-simple/#comment-88628508
Note that PHPSpec is discontinued:
http://blog.astrumfutura.com/2010/05/the-mockery-php-mock-objects-made-simple/#comment-88628508