PHPSpec - doesn't work, who uses it to develop php?

I searched for stackoverflow for this and did not find an answer

Starting with Ruby On Rails and Rspec, I need a tool like rspec (an easier transition). Installed it via PEAR and tried to start it, but it does not work (yet)

Just ask if anyone using it has the same problem as it doesn't work at all

tried to run 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 works

 phpspec some_dummy_value 

returns nothing

+3
source share
8 answers

Development at PHPSpec has been resumed since August 2010, after a two-year hiatus. Now the code base looks more stable. I'll try again.

The website is now at www.phpspec.net

Documentation can be found at http://www.phpspec.net/documentation . This is basically an update to the first version.

If you require further assistance, you can also contact the developers through your mailing list: http://groups.google.com/group/phpspec-dev

+6
source

I also could not start it, but you can also use BDD with PHPUnit. Check the documentation :

0
source

I was looking forward to using PHPSpec, oh, I think it will be tested on PHPUnit

0
source

I tried using phpspec but found it to be too buggy / immature. I can highly recommend SimpleTest for writing unittests.

0
source

You can write RSpec-ish test types in PHPUnit, but this gets in the way of a few things.

  • PHPUnit mocks does not allow you to re-declare them, so it’s hard to set up a bunch of stubs in and then redefine them as needed. You can get around this organization of installing stubs after expectations, but this is strange.

  • PHP is not as dynamic as Ruby, so you cannot easily make fun of or stifle a class of methods if you are specifically designing a class for this and even then it's pretty ugly. (This can change with PHP 5.3 late static binding function).

0
source

I have successfully used PHPSpec, but it is not actively developing now? This is great, but don’t think that I’ll go with a stalled project. In any case, I used the following setting to run tests from a web browser, maybe you will find something to help you configure it for the CLI.

PHPSpecConfiguration.php

 $projectDir = realpath( dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' ) . DIRECTORY_SEPARATOR; $simdal_root = $projectDir . 'library'; $phpspec_root = $projectDir . '..' . DIRECTORY_SEPARATOR . 'PHPSpec'; $mockery_root = $projectDir . '..' . DIRECTORY_SEPARATOR . 'Mockery'; $paths = array( 'SimDAL'=>$simdal_root, 'PHPSpec'=>$phpspec_root, 'Mockery'=>$mockery_root ); set_include_path( implode( PATH_SEPARATOR, $paths ) . PATH_SEPARATOR . get_include_path() ); require_once 'PHPSpec.php'; require_once 'Mockery/Framework.php'; class Custom_Autoload { public static function autoload($class) { //$path = dirname(dirname(__FILE__)); //include $path . '/' . str_replace('_', '/', $class) . '.php'; if (preg_match('/^([^ _]*)?(_[^ _]*)*$/', $class, $matches)) { include str_replace('_', '/', $class) . '.php'; return true; } return false; } } spl_autoload_register(array('Custom_Autoload', 'autoload')); 

and then a file that runs everything: AllSpecs.php;

 require_once 'PHPSpecTestConfiguration.php'; $options = new stdClass(); $options->recursive = true; $options->specdocs = true; $options->reporter = 'html'; PHPSpec_Runner::run($options); 

I don't like CLI testing ... But it might help someone.

0
source

Hi its pretty old Q. in fact, but I think http://behat.org/ should be here. Every problem should have a problem.

0
source

All Articles