CodeIgniter Testing Guide: Beginners' Guide to Automated Testing in PHP
Book information
Description
Who Should Read This Book?This book is for PHP developers who don't know Automated Testing or Unit Testing, or for those looking for help testing CodeIgniter applications.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.Table of ContentsChapter 1: What is Automated Testing?Let's begin learning about automated testing. First we will explore the basic concepts of automated testing. We will find out why and what you should test. At the same time, I will explain the ideas and testing policies used by this book.Chapter 2: Setting Up the Testing EnvironmentTo run tests in your PHP environment, you will need to install some additional software. For this book, this includes CodeIgniter, PHPUnit and a tool which acts as a bridge between them, ci-phpunit-test.Chapter 3: Test JargonWe define test jargon here. One of the annoying and confusing things in testing is the new vocabulary required to understand it. By the end of this chapter we'll help you understand the difference between Unit, Integration, and System testing; Functional and Acceptance testing; Fixtures and Mocks; and more.Chapter 4: PHPUnit BasicsIIn this chapter, we will learn the basics of PHPUnit. We will run PHPUnit and learn how to configure it. After that, we will study PHPUnit conventions and write our first test. We also cover PHPUnit functionality, data providers, fixtures, and assertions.Chapter 5: Testing a Simple MVC ApplicationYou've already learned how to write test code, so here we will write tests for a CodeIgniter Tutorial application. We will write tests for a controller and a model. In this chapter, we will use the database for model testing.Chapter 6: Unit Testing for ModelsWe will learn more about testing models. We will write tests for models without using the database. To do this, we will learn about PHPUnit mock objects.Chapter 7: Testing ControllersWe will learn more about testing controllers in this and the next two chapters. In this chapter, we will write tests for a controller for reviewing, and write tests with mocking models. We also will write test cases for authentication and redirects.Chapter 8: Unit Testing CLI ControllersWe will continue learning to write tests for controllers. In this chapter, we will write unit tests for controllers, and learn about monkey patching.Chapter 9: Testing REST ControllersIn this chapter, we will learn about testing REST controllers. You will learn how to send (emulate) requests with methods other than GET and POST.Chapter 10: Browser Testing with CodeceptionIn previous chapters, we have been using PHPUnit. In this chapter, we will learn about another testing tool. We will install Codeception, learn to configure it, and write tests which work with the web browser.
Similar books
Machine Learning in Medical Imaging: Second International Workshop, MLMI 2011, Held in Conjunction with MICCAI 2011, Toronto, Canada, September 18, 2011. Proceedings
2011 · PDF
Interpretability of Machine Intelligence in Medical Image Computing and Multimodal Learning for Clinical Decision Support: Second International Workshop, iMIMIC 2019, and 9th International Workshop, ML-CDS 2019, Held in Conjunction with MICCAI 2019, Shenzhen, China, October 17, 2019, Proceedings
2019 · PDF
Cybernics: Fusion of human, machine and information systems
2014 · PDF
Testing of Software and Communicating Systems: 20th IFIP TC 6/WG 6.1 International Conference, TestCom 2008 8th International Workshop, FATES 2008 Tokyo, Japan, June 10-13, 2008 Proceedings
2008 · PDF
Machine Learning in Medical Imaging: 4th International Workshop, MLMI 2013, Held in Conjunction with MICCAI 2013, Nagoya, Japan, September 22, 2013. Proceedings
2013 · PDF
Machine Learning in Medical Imaging: Second International Workshop, MLMI 2011, Held in Conjunction with MICCAI 2011, Toronto, Canada, September 18, 2011. Proceedings
2011 · PDF
Machine Learning in Medical Imaging: First International Workshop, MLMI 2010, Held in Conjunction with MICCAI 2010, Beijing, China, September 20, 2010. Proceedings
2010 · PDF
Artificial neural networks - methodological advances and biomedical applications
2011 · PDF