Conteúdo Programatico
Introduction To Unit Test
- What are unit tests ?
- Pros and cons
- The FIRST rule
Introduction To Php Unit
- Introduction to PHP Unit
- Open Source PHP projects use PHP Unit
- IDEs integration
- PHPUnit installation from PEAR
Write Your First Assertions
- Introduction to the Command Line Interface
- Write a first tests suite
- Run the test suite from the command line tool
Initialize And Reset A Test
- Setup a tests suite with the setup() method
- Reset a testing environment with the tearDown() method
- Introduction to fixtures
Testing Exceptions
- Write unit tests for methods, which can handle exceptions
- Testing exception with the setExpectedException() assertion method
- Testing exception by using the @expectedException annotation
- Testing exception thanks to a try { } catch code block
Test Driven Development
- Understanding the test driven development (TDD) methodology
- Main advantages of the TDD approach
- Implement code thanks to a test driven development approach
Data Providers And Fixtures
- Understanding the data providers and fixtures concepts
- Create a new data provider method to run a test with several values
Advanced Testing Practices
- Testing exceptions
- Using data providers to create fixtures
- Assertions to test a class and its attributes
- Assertions to test Boolean values
- Assertions to test string values
- Assertions to test XML values
Code Coverage Analysis
- Understanding the code coverage concept
- Check XDebug extension is installed on the web server
- Generate a complete code coverage report from the command line interface
- Analyzing and understanding generated reports and statistics
- Understanding and using the special @covers annotation
- Ignore code blocks from coverage process thanks to @codeCoverageIgnore (Start|End) annotation
Using Mock Objects
- Discovering and creating mock objects
- Test data model coupled to mock objects
- Check code coverage rate thanks to advanced unit tests
Generating Reports
- Export results as XML
- Export results as JSON
- Export results as TAP
- Check code coverage rate thanks to advanced unit tests
Monitoring The Tests Suite With Jenkins
- Discovering the continuous integration practice
- Installing and running a continuous integration tool