Questions tagged [phpunit]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3
votes
1answer
41 views

How do I run CiviCRM PHPUnit tests from within Netbeans?

I want to run PHPUnit tests from within my IDE - and I know Karin G. has created excellent directions for PHPStorm, but I use Netbeans 8.2. What can I do?
2
votes
2answers
169 views

PHPUnit_Framework_BaseTestListener class not found

I am trying to run a PHPunit test for my extension but I keep getting the following error: Fatal error: Class 'PHPUnit_Framework_BaseTestListener' not found in C:\xampp\htdocs\myDrupalsite\sites\all\...
1
vote
0answers
117 views

How to write php unit test

I am having the below PHP class file. How do I create a TestCase or TestClass for this <?php class CRM_History_Page_HistoryPage extends CRM_Core_Page { public function run() { // Get User ...
1
vote
1answer
24 views

Unit Tests on Single DB

My rig has a CMS & Civi combined database. This was to make life easier through drush sql-sync from @prod to @dev. However, @dev is a vagrant box, with two databases, one for CMS, one for Civi. ...
2
votes
1answer
86 views

How do I write unit tests that verify a hook is being fired?

I found this example but it doesn't look like it would generalise to all hooks. The use case is for API4 - basically whenever any action is called I think we should be able to verify that particular ...
1
vote
0answers
61 views

How to spoof users to unit test ACL logic

Starting to think about unit testing access control permission logic in API calls. Is there an established pattern for this? Within CiviUnitTestCase and ACLPermissionTest there are these snips: ...
1
vote
1answer
26 views

Is there a copy of phpunit 4 documentation somewhere?

The phpunit no longer even lists the 4.8 documentation on its website although that seems to be the version buildkit is on. :-( are there docs for 4.8 somewhere?
1
vote
1answer
32 views

class Civi not found

I'm trying to use the Civi class to debug an extension with build kit, but after I add this line: `Civi::log()->info('Hello, log!');` to my class I get: ampuser@58e3a823b9ee:/opt/buildkit/...
7
votes
2answers
503 views

How do I run PHP Unit Tests w/ XDEBUG from within PHPStorm [on Mac]?

My tools: Instance generated with buildkit - civibuild: $ civibuild create dmaster --url http://d47.localhost --admin-pass mypass Mac OS + PHPStorm 8.0.4 + MAMP (/Applications/MAMP/bin/php/php5.6.10/...
3
votes
2answers
644 views

Does class autoloading not work in standalone phpunit testing?

I'm following civix's upgrade instructions to enable unit tests to be executed with standalone phpunit. I've got my code in a work-in-progress git branch. The first commit captures the civix-...