Questions tagged [tests]

Questions related to checking things: unit tests, performance tests, A/B testing, etc.

Filter by
Sorted by
Tagged with
2
votes
1answer
62 views

How do you unit test plugins?

I have Codeception running on my local install without errors, but it's not yet actually doing anything. I am building several plugins and I can't figure out how you actually test a plugin? I have no ...
0
votes
0answers
12 views

Testing - set different plugin settings for each test

Is it possible to set different settings of specific plugin (settings in php file located in config directory, no database involved) for each test?
1
vote
1answer
43 views

How do you save custom fields on an EntryFixture?

I can't for the life of me figure out how to setup EntryFixtures in craft to populate with custom fields. I'm using the project config which already has the sections and fields defined in my tests. I'...
1
vote
2answers
115 views

Namespace error with fixture (solved)

I've set up a fixture, but Codeception can't find it. What am I missing or doing wrong? % php vendor/bin/codecept run functional ... ...
4
votes
0answers
84 views

Testing / Fixtures: setup Entries in Structure

Background: I have experience with vanilla PHPUnit testing of projects, but this the first attempt at both testing a Craft project and using Codeception for testing. Case: I have a section of type ...
1
vote
0answers
88 views

What the best strategy to test Craft template?

I would like to know if there is a way unit test templates using Craft 2.5? For example trying to prevent null pointers happening in production when an image is remove from the entry
2
votes
1answer
327 views

Unit Testing with current version of Craft

Has Craft stopped shipping with unit tests? I'm trying to unit test a plugin and have noticed from several previous answers (e.g PHPUnit testing for Craft plugins or controllers) that it was possible ...
2
votes
2answers
613 views

Stub out the global craft() object for PHPUnit tests

As best I can tell, the 'mockBuilder' function is exactly what I want, and based on other examples, should work. Am I missing something? How can I stub out the global craft() object? under test: &...