Questions tagged [tests]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
24 views

Codeception Unit test using fullMock

I have a custom field for which I would like to write some basic unit tests. I was looking into fullMock: true since really don't need a full Craft environment. I want to test the normalizeValue() ...
thomas's user avatar
  • 131
2 votes
1 answer
37 views

Plugins with extensive tests

What are Craft plugins with extensive (codeception) tests in their repositories? I want to look at working examples. I also know that Craft repo itself and Commerce have tests set up.
Piotr Pogorzelski's user avatar
1 vote
1 answer
70 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 ...
boris's user avatar
  • 31
3 votes
1 answer
342 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 ...
Andy Moreno's user avatar
1 vote
1 answer
103 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'...
Myles Hyson's user avatar
1 vote
2 answers
445 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 ... ...
henry's user avatar
  • 228
4 votes
0 answers
178 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 ...
qrazi's user avatar
  • 141
1 vote
0 answers
125 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
jpoiri's user avatar
  • 231
2 votes
1 answer
367 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 ...
lowe_22's user avatar
  • 205
2 votes
2 answers
639 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: &...
nullsteph's user avatar
  • 141