Questions tagged [tests]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
12 views

Install a plugin in a unit test

I'm writing some unit tests for a plugin I've made using codeception. I need to test the installation of another plugin during a test. Defining the plugin in codeception.yml doesn't work, the plugin ...
0
votes
0answers
12 views

Why is $I->submitForm() always loading the homepage in functional tests?

For some reason whenever I try to use $I->submitForm() in functional tests for a form on the homepage, the homepage is loaded instead of the form action no matter what the form action is set to. I'...
2
votes
1answer
85 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
14 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
53 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
143 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
99 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
93 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
335 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
616 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: &...