Don't worry. This book is for you. ;-)
Quote:If one or more of the lines below sounds familiar, this book is perfect for you!
- I have never written test code.
- I want to write test code, but I don't know how.
- I tried to write test code in the past, but I couldn't quite figure it out.
First of all,
Active Record is a design pattern and the CodeIgniter 2.x's
Active Record is
not Active Record.
It is a
Query Builder. So the Active Record was renamed to Query Builder in CodeIgniter 3.0.
Second, you don't have to worry about Active Record or not. And you don't have to stick to
unit testing.
If unit testing is difficult, you could test with the database.
In the context of CodeIgniter 3.0, we can write unit tests for models. In other words, we can test models
without the database, using mock objects.
How to unit test models is explained in Chapter 6, which was released yesterday.
The answer to your question is like this:
- It may be difficult to unit test Active Record entities, but is not impossible.
- But I don't know unit testing them is useful or not. It depends on the code under test