Skip to main content
9 votes

How to find out about changes in the latest Release Candidate?

This is an excellent question. Before trying to answer, let me note a bit of the context: When defining a test plan, several organizational and technical factors can weigh-in (e.g. perhaps certain ...
Tim Otten's user avatar
  • 5,684
7 votes

ER diagram for the latest Civicrm , Foreign key in Structure, test cases/plans

I will answer your questions #1 and #2. (I'm not sure what you mean by #3. If #3 is sufficiently unrelated to #1 and #2, I would suggest creating a separate question for it) Why an ER (Entity ...
Sean's user avatar
  • 3,168
6 votes
Accepted

How to reset the headless test db?

ah-ha! In your test class edit the setUpHeadless() method which might look at first like this: public function setUpHeadless() { ...
artfulrobot's user avatar
  • 3,932
4 votes

How to set Stripe test mode on both Stripe & Webform-CiviCRM

On the CiviCRM part of the webform, in the 'Contribution' section there is a field 'Payment Processor Mode' where you can set either 'Test Mode' or 'Live Transactions' (and save this, of course, not ...
Andy Clark's user avatar
  • 4,945
4 votes
Accepted

ER diagram for the latest Civicrm , Foreign key in Structure, test cases/plans

2) You can use a tool like SchemaSpy to extract the structure of the database, have the foreign key displayed in a table or on a schema and navigate easily between related tables. You can see an ...
samuelsov's user avatar
  • 2,331
4 votes
Accepted

How to bootstrap CiviCRM with admin permissions in a Wordpress environment?

I recently pushed b3db22c002a5d16ae3715b97b58f3f64a1526a3a -- which adds the --user (-U) option and seems to work in WP/D7 (but hasn't been exhaustively tested). Try downloading the latest build of cv....
Tim Otten's user avatar
  • 5,684
4 votes

How to bootstrap CiviCRM with admin permissions in a Wordpress environment?

If wp-cli is an option, it takes a --user option, similarly to drush. If that's not an option, looking at the wp-cli source code (here) suggests that wp_set_current_user() will do the trick.
Jon G - Megaphone Tech's user avatar
3 votes

Quality assurance considerations for membership signups

I strongly prefer the approach of having a $1 membership type set up, and testing it with real cards and real money. For $2-3 I get full piece of mind that things are working. I generally only need to ...
petednz - fuzion's user avatar
  • 28.6k
2 votes
Accepted

Can I mock the CiviCRM API for unit tests?

Generally, you need to get a reference to the API kernel. (For testing, I usually build up a custom instance, but you can use Civi::service("civi_api_kernel")). Then call registerApiProvider(...) and ...
Tim Otten's user avatar
  • 5,684
2 votes
Accepted

How to write unit tests for methods thsat echo instead of return (e.g., AJAX call handlers)

Allan - I have tended to try to refactor the AJAX functions such that they call a more testable function & test that - this generally improves the code.... There are a few examples that test the ...
Eileen's user avatar
  • 96
2 votes

How to write unit tests for methods thsat echo instead of return (e.g., AJAX call handlers)

I'm a bit out of date on the current status of the civi test framework, but if WebTests are still available I would do this as a WebTest. https://wiki.civicrm.org/confluence/display/CRM/Setting+...
Demerit's user avatar
  • 24.1k
2 votes

How to test for CiviCRM status messages in selenium?

So one possibility is to use Selenium2TestCase as your base class for you test... I've been using Selenium Standalone Server 3.3 (looks like 3.4 just released) http://www.seleniumhq.org/download/ So ...
jackrabbithanna's user avatar
2 votes

Can't accesss cv from CiviUnitTestCase::createExternalAPI in buildkit environment

The error message says sh: 1: cv not found, so the symptom here is that the proc_open() call is unable to find the executable cv. It looked like the place to check this should be cv() function in ...
Chris Burgess's user avatar
2 votes
Accepted

Can cv handle custom Wordpress installs?

Thanks to the helpful comments, I conclude: Yes it can, with a bit of help. TL;DR you need to define CIVICRM_CMSDIR in your code you need set CIVICRM_SETTINGS as an environment var Longer version ...
artfulrobot's user avatar
  • 3,932
2 votes

ER diagram for the latest Civicrm , Foreign key in Structure, test cases/plans

We strongly discourage interacting directly with tables and fields in the database. Instead it is much safer to access data via the API, which has a convenient explorer. For those doing core work, ...
Joe Murray's user avatar
  • 6,741
2 votes

Creating a copy of CiviCRM on a test sub-domain (Wordpress)

Please refer to Moving an Existing Installation to a New Server or Location for this.
Christian Wach's user avatar
2 votes

Searching for Test Contributions

Thanks to Demerit. I used the box that says "Contribution is a Test? Yes No ". It's about half-way down on the left on the find contributions form (Contributions -> Find Contributions).
ArloGueswith's user avatar
2 votes
Accepted

Contribution Test Pages work only for Amount = $1.00

That's functioning as it should -> VISA 4222222222222220 / exp date in future and CVV any 3 digits -> will result in OK for all $amounts VISA 411111111111111 / exp date in future and CVV any 3 ...
KarinG - Semper IT's user avatar
1 vote

Contribution Pages are not working in Test-Drive Mode

It's hard to know without more information, but here are some possible causes: You don't have test payment credentials set up at Administer » System Settings » Payment Processors. You've reused your ...
Jon G - Megaphone Tech's user avatar
1 vote

How to change TO option in Outgoing email setup

The email will be the one on the contact record that connects to the user you are logged in as.
petednz - fuzion's user avatar
  • 28.6k
1 vote

Cyber security penetration testing

There was a Mozilla audit last year - see https://civicrm.org/blog/josh/quarterly-report-q1-2020 For general info see https://civicrm.org/security and https://docs.civicrm.org/sysadmin/en/latest/setup/...
Demerit's user avatar
  • 24.1k
1 vote

how to write PHP Unit test for an entity using hooks

An example is in tests/phpunit/CRM/Contribute/Form/Task/PDFLetterCommonTest.php, testing that hook_civicrm_tokenValues works correctly on PDF letters. You write a function using the hook, but you can ...
Jon G - Megaphone Tech's user avatar
1 vote

How can I see all test data in CiviCRM?

I am unaware of a way to turn on test data as you put it but here are some work arounds. To find test the records, in searches (advanced search, membership search etc) there is a field "Membership is ...
Gemma - Fuzion's user avatar
1 vote

How to reset the headless test db?

It's also worth noting that if you're using civicrm-buildkit to create your test sites (highly recommended) you can also rebuild a site with civibuild reinstall.
Jon G - Megaphone Tech's user avatar
1 vote
Accepted

How to build a Real Size Drupal+Civi Test Configuration?

Your error doesn't indicate a problem with your database - and it does sound like you've copied them correctly. This error indicates that you have a missing file in your file system. Is the webform ...
Jon G - Megaphone Tech's user avatar
1 vote

Command failed (cv php:boot --level=settings) when trying to run tests

Just adding some steps to check if basic things are met correctly. Make sure you are in civicrm folder when you run the test. $ cd <site_name>/sites/all/modules/civicrm $ export CIVICRM_UF=...
jitendra - fuzion's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible