Questions tagged [tests]

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

7 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
0answers
123 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
98 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
0
votes
0answers
7 views

Craft tests - FieldFixture - why does it manually adds and removes fields?

I was chcking out craft testing classes and notices that FieldFixture has custom load and uload methods that manually create and remove fields. Fixtures should add data and then remove it ...
0
votes
0answers
6 views

Testing fixtures - grabFixture method returns null

I set up codeception tests and copied some fixtures from Craft repository. Within unit test class, i can access fixtures data of elements, for example for EntryFixture. I use this code, where entries ...
0
votes
0answers
17 views

Testing adding fields to an entry type field layout

I'm writing unit tests for a plugin that reacts to adding fields to field layouts, I'm trying to add fields to a layout programmatically but can't get anywhere, In the example below (method ...
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'...
0
votes
0answers
15 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?