php - How do I successfully create a project with Zend Framework and PHPUnit? -



php - How do I successfully create a project with Zend Framework and PHPUnit? -

let me start saying i've posted multiple forums , tried help on zf irc channel. i've been googling straight week , still no results. i've read lot of q's , a's on site in past, figured i'd create business relationship , seek asking you.

(yes, i've searched asked questions, none of answers helped me.)

i'm trying larn how utilize zend framework new project i've joined. compatibility reasons using zend 1 (and not newer zend 2). have found , followed number of online , physical book tutorials i've same results on , on again.

so here goes (this instructions tutorials give). went framework.zend.com , downloaded total version of zf 1.12.

i unzipped contents i moved library folder safe directory won't modified i moved contents of bin folder same directory php executable i changed include_path in php.ini file include library directory i updated windows path variable create sure included path php executable

i ran

zf --help

this command worked intended. ran zf show version (zend framework version 1.12.7).

i ran command

zf create project myproject

upon doing this, receiving next error message:

fatal error: class 'phpunit_framework_testcase' not found in d:\zend\library\zend\test\phpunit\controllertestcase.php on line 48

that particular line in question class declaration extends phpunit_framework_testcase. i don't know phpunit_framework_testcase defined. not in any of files or directories came in single zip file downloaded zend. ran grep on files , folders searching string "class phpunit_framework_testcase" printed no results.

some have suggested don't have phpunit installed (which obvious me now). part bugs me absolutely none of tutorials read mention installing phpunit before hand or how install or dependencies zend has on it. many of these beginner tutorials assumed had basic knowledge of php, , it's pretty shocking me none mentioned phpunit. if phpunit of import think file downloaded zend have included it. guess not.

so went online 1 time again , got phar file phpunit, what? tried putting in multiple different directories still same error. not supposed utilize phar file? should using actual files instead?

what have zf recognize phpunit, resolve error , create first zf project?

additional info: windows 7, xampp server (running on localhost), php 5.5.6

assuming have phpunit installed , on include path (bearing in mind zf1 officially supports phpunit 3.4.x , doesn't back upwards above phpunit 3.5.x, if you're using xampp may have downgrade phpunit described here). problem due commit, require calls phpunit stripped out in favour of using autoloader. zf tool on cli doesn't set autoloader though, phpunit not found because not required! prepare can homecoming these lines start of zend/test/phpunit/controllertestcase.php

/** @see phpunit_runner_version */ require_once 'phpunit/runner/version.php'; /** * depending on version, include proper phpunit back upwards * @see phpunit_autoload */ require_once (version_compare(phpunit_runner_version::id(), '3.5.0', '>=')) ? 'phpunit/autoload.php' : 'phpunit/framework.php';

it's worth noting error mention, zf tool should still work correctly when setting project, won't produce unit test actions (you'll have create them yourself). if don't want downgrade xampp phpunit version should able add together right version locally project using composer described here.

update jan 2015: downgrading phpunit xampp no longer necessary zf1 has supported @ to the lowest degree version 4.1 of phpunit since 1.12.7 (i've not tested above 4.1). helpful phpunit has completely removed deprecated pear repository of dec 2014, means can't download versions older 3.7 anymore anyway! (currently xampp ships phpunit 3.6). these days though it's worth chucking xampp vagrant , globally installing phpunit 4.1 via composer during vagrant provisioning.

php zend-framework phpunit

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -