PHPUnit Essentials - Helion
ebook
Autor: Zdenek MachekTytuł oryginału: PHPUnit Essentials.
ISBN: 9781783283446
stron: 314, Format: ebook
Data wydania: 2014-05-27
Księgarnia: Helion
Cena książki: 94,99 zł
Osoby które kupowały "PHPUnit Essentials", wybierały także:
- Windows Media Center. Domowe centrum rozrywki 66,67 zł, (8,00 zł -88%)
- Ruby on Rails. Ćwiczenia 18,75 zł, (3,00 zł -84%)
- Przywództwo w świecie VUCA. Jak być skutecznym liderem w niepewnym środowisku 58,64 zł, (12,90 zł -78%)
- Scrum. O zwinnym zarządzaniu projektami. Wydanie II rozszerzone 58,64 zł, (12,90 zł -78%)
- Od hierarchii do turkusu, czyli jak zarządzać w XXI wieku 58,64 zł, (12,90 zł -78%)
Spis treści
PHPUnit Essentials eBook -- spis treści
- PHPUnit Essentials
- Table of Contents
- PHPUnit Essentials
- Credits
- About the Author
- About the Reviewers
- www.PacktPub.com
- Support files, eBooks, discount offers, and more
- Why subscribe?
- Free access for Packt account holders
- Support files, eBooks, discount offers, and more
- Preface
- What this book covers
- What you need for this book
- Who this book is for
- Conventions
- Reader feedback
- Customer support
- Downloading the example code
- Downloading the color images of this book
- Errata
- Piracy
- Questions
- 1. Installing PHPUnit
- Requirements
- Running PHP from the command line
- Composer the dependency manager for PHP
- Installing Composer
- Installation
- Local installation
- System-wide installation
- Installing PEAR
- PHPUnit installation
- Other installation methods
- Installing the Linux package
- Manual installation
- Testing the installation
- Xdebug
- Installing Xdebug
- Xdebug
- Summary
- Requirements
- 2. PHPUnit Support in IDEs
- IDEs and PHPUnit
- NetBeans
- Zend Studio
- Eclipse PDT
- Installing MakeGood
- Creating your FirstTest
- PhpStorm
- Summary
- IDEs and PHPUnit
- 3. Tests and What Theyre All About
- Understanding unit testing
- What is a unit test?
- Assertions
- The importance of unit testing
- Testing all possible scenarios
- What makes a good test?
- When to write tests
- Anatomy of a PHPUnit test
- Defining test methods
- Testing functions
- Testing methods
- The MVC application architecture and tests
- Testing controllers
- Summary
- Understanding unit testing
- 4. Testing Dependencies and Exceptions
- Detecting dependencies
- Handling dependencies
- Exceptions are expected
- Testing errors and exceptions
- Summary
- 5. Running Tests from the Command Line
- Running tests
- Processing test results
- Test statuses
- Command-line switches
- Logging results
- Code coverage
- Including and excluding tests from the execution
- When to stop the test execution
- Configuration options
- Code coverage analysis
- Processing test results
- Summary
- Running tests
- 6. Test Isolation and Interaction
- Test fixtures
- Before and after each test method
- Before and after each test suite class
- Global state
- Test dependencies
- Data providers
- Summary
- Test fixtures
- 7. Organizing Tests
- The PHPUnit XML configuration file
- Test listeners
- Configuring the code coverage
- Where to store tests
- Test suites
- Groups
- Using the bootstrap file
- Summary
- The PHPUnit XML configuration file
- 8. Using Test Doubles
- Creating test doubles
- Test doubles in action
- Using fake
- Using stubs
- Using mocks and expectations
- Test proxies
- Understanding Mockery
- Installation methods
- Comparing Mockery to PHPUnit
- How to use Mockery
- Summary
- 9. Database Testing
- Which database to use
- Tests for a database
- DBUnit
- Installing DBUnit
- Database test cases
- Datasets
- Using DBUnit
- Doctrine 2 ORM and database testing
- Summary
- 10. Testing APIs
- An example of integration testing
- Testing the PayPal API
- Testing the Facebook API
- Testing the Twitter API
- Testing the service-oriented architecture
- Summary
- 11. Testing Legacy Code
- Testing spaghetti code
- Black box testing
- Using Reflection
- Handling dependencies
- The Patchwork library
- The vfsStream library
- The runkit PHP extension
- Summary
- Testing spaghetti code
- 12. Functional Tests in the Web Browser Using Selenium
- Installing Selenium
- The Selenium IDE
- The Selenium Server
- Installing drivers
- The PHPUnit Selenium extension
- Testing in the browser
- Recording Selenium tests
- PHPUnit Selenium2TestCase
- Writing Selenium tests
- PHP-SeleniumClient
- Organizing Selenium tests
- Summary
- Installing Selenium
- 13. Continuous Integration
- Using a Travis CI hosted service
- Setting up Travis CI
- Using Travis CI
- Using the Jenkins CI server
- Installation
- Usage
- Creating a job
- Source Code Management
- Build Triggers
- Build
- Post-build Actions
- Results
- Creating a job
- Using the Xinc PHP CI server
- Installation
- Usage
- Summary
- Using a Travis CI hosted service
- 14. PHPUnit Alternatives, Extensions, Relatives, and BDD
- Unit testing alternatives
- PHPUnit extensions
- Behavior-driven development
- Understanding BDD
- Testing with PHPSpec
- Installing PHPSpec
- Using PHPSpec
- Functional testing with Behat
- Installing Behat
- Using Behat
- Summary
- Index