The Definitive Guide to Yii

Total Page:16

File Type:pdf, Size:1020Kb

The Definitive Guide to Yii The Definitive Guide to Yii 1.1 Qiang Xue and Xiang Wei Zhuo Copyright 2008-2010. All Rights Reserved. Contents Contents i License xi 1 Getting Started1 1.1 The Definitive Guide to Yii...........................1 1.2 New Features...................................1 1.2.1 Version 1.1.2...............................1 1.2.2 Version 1.1.1...............................1 1.2.3 Version 1.1.0...............................1 1.2.4 Version 1.0.11...............................2 1.2.5 Version 1.0.10...............................2 1.2.6 Version 1.0.8...............................2 1.2.7 Version 1.0.7...............................3 1.2.8 Version 1.0.6...............................3 1.2.9 Version 1.0.5...............................3 1.3 Upgrading from Version 1.0 to 1.1.......................4 1.3.1 Changes Related with Model Scenarios.................4 1.3.2 Changes Related with Eager Loading for Relational Active Record.4 1.3.3 Changes Related with Table Alias in Relational Active Record...5 1.3.4 Changes Related with Tabular Input..................5 ii Contents 1.3.5 Other Changes..............................5 1.4 What is Yii....................................5 1.4.1 Requirements...............................5 1.4.2 What is Yii Best for?..........................5 1.4.3 How is Yii Compared with Other Frameworks?............6 1.5 Installation....................................6 1.5.1 Requirements...............................6 1.6 Creating First Yii Application..........................7 1.6.1 Connecting to Database......................... 11 1.6.2 Implementing CRUD Operations.................... 12 2 Fundamentals 17 2.1 Model-View-Controller (MVC)......................... 17 2.1.1 A Typical Workflow........................... 18 2.2 Entry Script.................................... 19 2.2.1 Debug Mode............................... 19 2.3 Application.................................... 20 2.3.1 Application Configuration........................ 20 2.3.2 Application Base Directory....................... 21 2.3.3 Application Component......................... 21 2.3.4 Core Application Components..................... 22 2.3.5 Application Lifecycles.......................... 23 2.4 Controller..................................... 24 2.4.1 Route................................... 24 2.4.2 Controller Instantiation......................... 25 Contents iii 2.4.3 Action................................... 25 2.4.4 Filter................................... 26 2.5 Model....................................... 28 2.6 View........................................ 29 2.6.1 Layout................................... 29 2.6.2 Widget.................................. 30 2.6.3 System View............................... 31 2.7 Component.................................... 31 2.7.1 Component Property........................... 31 2.7.2 Component Event............................ 32 2.7.3 Component Behavior........................... 33 2.8 Module...................................... 35 2.8.1 Creating Module............................. 35 2.8.2 Using Module............................... 36 2.8.3 Nested Module.............................. 37 2.9 Path Alias and Namespace........................... 37 2.10 Conventions.................................... 39 2.10.1 URL.................................... 39 2.10.2 Code.................................... 39 2.10.3 Configuration............................... 40 2.10.4 File.................................... 40 2.10.5 Directory................................. 40 2.10.6 Database................................. 41 2.11 Development Workflow.............................. 42 iv Contents 3 Working with Forms 45 3.1 Working with Form................................ 45 3.2 Creating Model.................................. 45 3.2.1 Defining Model Class........................... 46 3.2.2 Declaring Validation Rules....................... 46 3.2.3 Securing Attribute Assignments..................... 49 3.2.4 Triggering Validation........................... 52 3.2.5 Retrieving Validation Errors...................... 53 3.2.6 Attribute Labels............................. 53 3.3 Creating Action.................................. 53 3.4 Creating Form.................................. 55 3.5 Collecting Tabular Input............................. 57 3.6 Using Form Builder............................... 58 3.6.1 Basic Concepts.............................. 59 3.6.2 Creating a Simple Form......................... 59 3.6.3 Specifying Form Elements........................ 61 3.6.4 Accessing Form Elements........................ 64 3.6.5 Creating a Nested Form......................... 65 3.6.6 Customizing Form Display....................... 67 4 Working with Databases 69 4.1 Working with Database............................. 69 4.2 Data Access Objects (DAO)........................... 69 4.2.1 Establishing Database Connection................... 70 4.2.2 Executing SQL Statements....................... 71 Contents v 4.2.3 Fetching Query Results......................... 72 4.2.4 Using Transactions............................ 72 4.2.5 Binding Parameters........................... 73 4.2.6 Binding Columns............................. 74 4.2.7 Using Table Prefix............................ 74 4.3 Active Record................................... 74 4.3.1 Establishing DB Connection....................... 75 4.3.2 Defining AR Class............................ 76 4.3.3 Creating Record............................. 78 4.3.4 Reading Record.............................. 79 4.3.5 Updating Record............................. 82 4.3.6 Deleting Record............................. 82 4.3.7 Data Validation.............................. 83 4.3.8 Comparing Records........................... 84 4.3.9 Customization.............................. 84 4.3.10 Using Transaction with AR....................... 84 4.3.11 Named Scopes.............................. 85 4.4 Relational Active Record............................ 87 4.4.1 Declaring Relationship.......................... 88 4.4.2 Performing Relational Query...................... 90 4.4.3 Relational Query Options........................ 92 4.4.4 Disambiguating Column Names..................... 94 4.4.5 Dynamic Relational Query Options................... 94 4.4.6 Relational Query Performance..................... 95 vi Contents 4.4.7 Statistical Query............................. 96 4.4.8 Relational Query with Named Scopes................. 98 5 Caching 101 5.1 Caching...................................... 101 5.2 Data Caching................................... 103 5.2.1 Cache Dependency............................ 104 5.3 Fragment Caching................................ 105 5.3.1 Caching Options............................. 105 5.3.2 Nested Caching.............................. 107 5.4 Page Caching................................... 108 5.5 Dynamic Content................................. 109 6 Extending Yii 111 6.1 Overview..................................... 111 6.2 Using Extensions................................. 112 6.2.1 Zii Extensions............................... 112 6.2.2 Application Component......................... 113 6.2.3 Behavior.................................. 113 6.2.4 Widget.................................. 114 6.2.5 Action................................... 115 6.2.6 Filter................................... 115 6.2.7 Controller................................. 116 6.2.8 Validator................................. 116 6.2.9 Console Command............................ 117 Contents vii 6.2.10 Module.................................. 117 6.2.11 Generic Component........................... 117 6.3 Creating Extensions............................... 118 6.3.1 Application Component......................... 118 6.3.2 Behavior.................................. 119 6.3.3 Widget.................................. 119 6.3.4 Action................................... 121 6.3.5 Filter................................... 121 6.3.6 Controller................................. 121 6.3.7 Validator................................. 122 6.3.8 Console Command............................ 122 6.3.9 Module.................................. 122 6.3.10 Generic Component........................... 123 6.4 Using 3rd-Party Libraries............................ 123 7 Testing 125 7.1 Overview..................................... 125 7.2 Test-Driven Development............................ 126 7.3 Test Environment Setup............................. 126 7.4 Test Bootstrap Script.............................. 127 7.5 Defining Fixtures................................. 128 7.6 Unit Testing.................................... 130 7.7 Functional Testing................................ 132 8 Special Topics 135 viii Contents 8.1 Automatic Code Generation........................... 135 8.1.1 Using Gii................................. 135 8.1.2 Extending Gii............................... 137 8.2 URL Management................................ 143 8.2.1 Creating URLs.............................. 143 8.2.2 User-friendly URLs............................ 144 8.3 Authentication and Authorization....................... 149 8.3.1 Defining Identity Class.......................... 149 8.3.2 Login and Logout............................ 151 8.3.3 Access Control Filter........................... 151 8.3.4 Role-Based Access Control....................... 154 8.4 Theming...................................... 160 8.4.1 Skin.................................... 162 8.5 Logging...................................... 164 8.5.1 Message Logging............................
Recommended publications
  • The Yii Framework – Larry Ullman
    The Yii Framework – Larry Ullman This is a copy of the Larry Ullman series ‘Learning the Yii Framework’. See http://www.larryullman.com/2009/06/18/introduction-to-the-yii-framework/. 1. Introduction to the Yii Framework In 2009, I had three decent-size Web sites to develop, so I thought I might try using a PHP framework for the first time, instead of coding everything from scratch. I’ve used Ruby on Rails for Web development before, so I’m comfortable with frameworks and the MVC architecture, but I wanted to educate myself on PHP frameworks. After researching a handful of frameworks, and after an unsatisfying attempt to use Zend Framework, I finally settled on, and really came to appreciate the Yii Framework. At the time, the Yii Framework was still quite new, and there are still bugs to be worked out (for the more advanced stuff), but Yii works so well that it’s very easy to use. In this first of several posts on the Yii Framework, I just discuss setting up and testing Yii. (Note: In October 2010, I’ve updated this entire series to reflect changes in Yii since this series was written, and to take into account feedback provided through the comments. Some outdated material will be crossed out, but left in to reflect how things have changed since the series was begun in June 2009.) The first thing you need in order to use the Yii Framework is access to a Web server with PHP installed, of course. But if you’re reading this, I’m going to assume you have access to a PHP-enabled server.
    [Show full text]
  • Codeigniter-Testing-Guide-Sample.Pdf
    CodeIgniter Testing Guide Beginners’ Guide to Automated Testing in PHP. Kenji Suzuki and Mat Whitney This book is for sale at http://leanpub.com/codeigniter-testing-guide This version was published on 2016-01-23 This is a Leanpub book. Leanpub empowers authors and publishers with the Lean Publishing process. Lean Publishing is the act of publishing an in-progress ebook using lightweight tools and many iterations to get reader feedback, pivot until you have the right book and build traction once you do. © 2015 - 2016 Kenji Suzuki and Mat Whitney Tweet This Book! Please help Kenji Suzuki and Mat Whitney by spreading the word about this book on Twitter! The suggested hashtag for this book is #CITestGuide. Find out what other people are saying about the book by clicking on this link to search for this hashtag on Twitter: https://twitter.com/search?q=#CITestGuide Contents Preface ............................................... i The Book at a Glance ..................................... i What You Need for This Book ................................. iii Who should read This Book? ................................. iii Why PHPUnit? ........................................ iv Is This a CodeIgniter Book? .................................. iv Is Testing PHP Applications Difficult? ............................ iv Is Testing CodeIgniter Applications Difficult? .................... v Testing is Fun and Easy ................................ v Conventions Used in This Book ................................ v Errata .............................................
    [Show full text]
  • Bakalářská Práce
    TECHNICKÁ UNIVERZITA V LIBERCI Fakulta mechatroniky, informatiky a mezioborových studií BAKALÁŘSKÁ PRÁCE Liberec 2013 Jaroslav Jakoubě Příloha A TECHNICKÁ UNIVERZITA V LIBERCI Fakulta mechatroniky, informatiky a mezioborových studií Studijní program: B2646 – Informační technologie Studijní obor: 1802R007 – Informační technologie Srovnání databázových knihoven v PHP Benchmark of database libraries for PHP Bakalářská práce Autor: Jaroslav Jakoubě Vedoucí práce: Mgr. Jiří Vraný, Ph.D. V Liberci 15. 5. 2013 Prohlášení Byl(a) jsem seznámen(a) s tím, že na mou bakalářskou práci se plně vztahuje zákon č. 121/2000 Sb., o právu autorském, zejména § 60 – školní dílo. Beru na vědomí, že Technická univerzita v Liberci (TUL) nezasahuje do mých autorských práv užitím mé bakalářské práce pro vnitřní potřebu TUL. Užiji-li bakalářskou práci nebo poskytnu-li licenci k jejímu využití, jsem si vědom povinnosti informovat o této skutečnosti TUL; v tomto případě má TUL právo ode mne požadovat úhradu nákladů, které vynaložila na vytvoření díla, až do jejich skutečné výše. Bakalářskou práci jsem vypracoval(a) samostatně s použitím uvedené literatury a na základě konzultací s vedoucím bakalářské práce a konzultantem. Datum Podpis 3 Abstrakt Česká verze: Tato bakalářská práce se zabývá srovnávacím testem webových aplikací psaných v programovacím skriptovacím jazyce PHP, které využívají různé knihovny pro komunikaci s databází. Hlavní důraz při hodnocení výsledků byl kladen na rychlost odezvy při zasílání jednotlivých požadavků. V rámci řešení byly zjišťovány dostupné metodiky určené na porovnávání těchto projektů. Byl také proveden průzkum zjišťující, které frameworky jsou nejvíce používané. Klíčová slova: Testování, PHP, webové aplikace, framework, knihovny English version: This bachelor’s thesis is focused on benchmarking of the PHP frameworks and their database libraries used for creating web applications.
    [Show full text]
  • YOSSEF BENHAROSH RESUME 972 (0) 544-308209 | [email protected] | Kiryat Gat, Israel
    YOSSEF BENHAROSH RESUME 972 (0) 544-308209 | [email protected] | Kiryat Gat, Israel PHP & Drupal developer, June 2011 – present Freelance web developer for 4 years who works with the following technologies: PHP, MySQL, Javascript, jQuery, Drupal, HTML/HTML5, CSS/CSS3. Specializes in PHP development. Including: Object-Oriented Programming, mySQL as a data base, and Laravel as a framework. Drupal developer, specializing in developing new modules and themes, and in taming existing modules. Good working knowledge of organic SEO. Chosen works freefax.co.il – PHP site that provides fax services. I worked as a PHP and mySQL programmer, as well as on the front end with jQuery, Ajax, html and CSS. I wrote the cart and invoice modules and the user class. puzzlemedia.co.il – Bilingual Drupal website for film producers. www.yaronlivne.co.il – Drupal based app that I wrote most of its modules and developed its’ theme. ZEZBRA – A startup that I themed its Drupal site, as well as developed its PHP based cellular version. reshetech.co.il – Hebrew tutorials website based on PHP. phpenthusiast.com – English tutorials website devoted to Object Oriented PHP. Github projects myAPI – I think it is the simplest way to provide API services for small businesses that want to provide data based services to their customers. csvtax – Drupal 7 module that transforms a CSV file into hierarchical taxonomy. cornerslider – A jQuery popup that slides the content in and out when the user scrolls down and up the page. Technologies Back end programming languages: PHP, mySQL. Front end programming languages: CSS/3, HTML/5, javascript.
    [Show full text]
  • Environmental Assessment DOI-BLM-ORWA-B050-2018-0016-EA
    United States Department of the Interior Bureau of Land Management Burns District Office 28910 Highway 20 West Hines, Oregon 97738 541-589-4400 Phone 541-573-4411 Fax Spay Feasibility and On-Range Behavioral Outcomes Assessment and Warm Springs HMA Population Management Plan Environmental Assessment DOI-BLM-ORWA-B050-2018-0016-EA June 29, 2018 This Page is Intentionally Left Blank Spay Feasibility and On-Range Behavioral Outcomes Assessment and Warm Springs HMA Population Management Plan Environmental Assessment DOI-BLM-ORWA-B050-2018-0016-EA Table of Contents I. INTRODUCTION .........................................................................................................1 A. Background................................................................................................................ 1 B. Purpose and Need for Proposed Action..................................................................... 4 C. Decision to be Made .................................................................................................. 5 D. Conformance with BLM Resource Management Plan(s) .......................................... 6 E. Consistency with Laws, Regulations and Policies..................................................... 7 F. Scoping and Identification of Issues ........................................................................ 12 1. Issues for Analysis .......................................................................................... 13 2. Issues Considered but Eliminated from Detailed Analysis ............................
    [Show full text]
  • 1 Introducing Symfony, Cakephp, and Zend Framework
    1 Introducing Symfony, CakePHP, and Zend Framework An invasion of armies can be resisted, but not an idea whose time has come. — Victor Hugo WHAT’S IN THIS CHAPTER? ‰ General discussion on frameworks. ‰ Introducing popular PHP frameworks. ‰ Design patterns. Everyone knows that all web applications have some things in common. They have users who can register, log in, and interact. Interaction is carried out mostly through validated and secured forms, and results are stored in various databases. The databases are then searched, data is processed, and data is presented back to the user, often according to his locale. If only you could extract these patterns as some kind of abstractions and transport them into further applications, the developmentCOPYRIGHTED process would be much MATERIAL faster. This task obviously can be done. Moreover, it can be done in many different ways and in almost any programming language. That’s why there are so many brilliant solutions that make web development faster and easier. In this book, we present three of them: Symfony, CakePHP, and Zend Framework. They do not only push the development process to the extremes in terms of rapidity but also provide massive amounts of advanced features that have become a must in the world of Web 2.0 applications. cc01.indd01.indd 1 11/24/2011/24/2011 55:45:10:45:10 PPMM 2 x CHAPTER 1 INTRODUCING SYMFONY, CAKEPHP, AND ZEND FRAMEWORK WHAT ARE WEB APPLICATION FRAMEWORKS AND HOW ARE THEY USED? A web application framework is a bunch of source code organized into a certain architecture that can be used for rapid development of web applications.
    [Show full text]
  • Implementación De Framework De Desarrollo Web Durante Un Proyecto”
    UNIVERSIDAD POLITÉCNICA DE SINALOA PROGRAMA ACADÉMICO DE INGENIERÍA EN INFORMÁTICA Tesina “Implementación de Framework de desarrollo web durante un proyecto” Para obtener la acreditación de las estadías profesionales y contar con los créditos para el grado de Ingeniero en Informática. Autor: Bernal Corral Daniel Asesor: M. C. Alejandro Pérez Pasten Borja Asesor OR: Ing. Omar Vidaña Peraza Mazatlán, Sinaloa 13 de Diciembre del 2019 Agradecimientos Agradezco a mis padres por brindarme todo su apoyo durante mis estudios, por darme las clases más importantes, por haber hecho posible que llegara a este momento, por enseñarme que no siempre todo sale perfecto y que debo esforzarme para obtener lo que quiero, por darme ánimos para seguir, por preocuparse por mí y esforzarse para que mi vida fuera mejor. A mi asesor por aconsejarme y corregir los errores que cometí durante el desarrollo de la tesina, por tomarse el tiempo para ver cada detalle y hacer recomendaciones, sugerir opciones, etc. A mi hermano por ayudarme a no rendirme, por asumir su rol de hermano mayor y tratar de guiar, por preocuparse por mí y ayudarme siempre que lo he necesitado. A los profesores que he tenido a lo largo de mis estudios y que me aportaron un poco de su conocimiento para enriquecer el mío. A todos mis compañeros que me ayudaron a hacer más amenas las clases. 6 ÍNDICE TEMÁTICO Índice de imágenes. 9 Resumen. ….. .11 Abstract. …. .11 Introducción. 11 Capítulo I. .. ... …12 1. Antecedentes. .. 13 1.1. Localización. .. ….. 13 1.2. Objetivos de la institución. …………….. 13 1.3. Visión. .14 1.4.
    [Show full text]
  • Cakephp Cookbook Documentation Release 4.X
    CakePHP Cookbook Documentation Release 4.x Cake Software Foundation Sep 25, 2021 Contents 1 CakePHP at a Glance 1 Conventions Over Configuration........................................1 The Model Layer................................................1 The View Layer.................................................2 The Controller Layer..............................................2 CakePHP Request Cycle............................................3 Just the Start...................................................4 Additional Reading...............................................4 2 Quick Start Guide 13 Content Management Tutorial......................................... 13 CMS Tutorial - Creating the Database..................................... 15 CMS Tutorial - Creating the Articles Controller................................ 19 3 4.0 Migration Guide 29 Deprecated Features Removed......................................... 29 Deprecations.................................................. 29 Breaking Changes................................................ 31 New Features.................................................. 37 4 Tutorials & Examples 41 Content Management Tutorial......................................... 41 CMS Tutorial - Creating the Database..................................... 43 CMS Tutorial - Creating the Articles Controller................................ 47 CMS Tutorial - Tags and Users......................................... 56 CMS Tutorial - Authentication......................................... 64 CMS Tutorial - Authorization.........................................
    [Show full text]
  • PHP 7 Y Laravel
    PHP 7 y Laravel © All rights reserved. www.keepcoding.io 1. Introducción Nada suele ser tan malo como lo pintan © All rights reserved. www.keepcoding.io When people tell me PHP is not a real programming language http://thecodinglove.com/post/114654680296 © All rights reserved. www.keepcoding.io Quién soy • Alicia Rodríguez • Ingeniera industrial ICAI • Backend developer • @buzkall • buzkall.com http://buzkall.com © All rights reserved. www.keepcoding.io ¿Qué vamos a ver? • Instalación y desarrollo en local • PHP 7 • Laravel • Test unitarios • Cómo utilizar una API externa © All rights reserved. www.keepcoding.io ¿Qué sabremos al terminar? • PHP mola • Crear un proyecto de cero • Depurar y hacer test a nuestro código • Un poco de análisis técnico y bolsa © All rights reserved. www.keepcoding.io Seguridad Security is not a characteristic of a language as much as it is a characteristic of a developer Essential PHP Security. Chris Shiflett. O’Reilly © All rights reserved. www.keepcoding.io Popularidad en Stackoverflow http://stackoverflow.com/research/developer-survey-2016 © All rights reserved. www.keepcoding.io Popularidad en Github http://redmonk.com/sogrady/2016/07/20/language-rankings-6-16/ © All rights reserved. www.keepcoding.io Frameworks por lenguaje https://hotframeworks.com/ © All rights reserved. www.keepcoding.io Su propia descripción • PHP is a popular general-purpose scripting language that is especially suited to web development. • Fast, flexible and pragmatic, PHP powers everything from your blog to the most popular websites in the world. https://secure.php.net/ © All rights reserved. www.keepcoding.io Historia de PHP • Creado por Rasmus Lerdorf en 1995 como el conjunto de scripts "Personal Home Page Tools", referenciado como "PHP Tools”.
    [Show full text]
  • Phpunit Manual Release Latest
    PHPUnit Manual Release latest Sebastian Bergmann Aug 18, 2021 Contents 1 Installing PHPUnit 3 1.1 Requirements...............................................3 1.2 Recommended PHP configuration....................................3 1.3 PHP Archive (PHAR)..........................................3 1.3.1 PHAR Implementation Details.................................4 1.3.2 Verifying PHPUnit PHAR Releases..............................4 1.4 Composer.................................................5 1.5 Global Installation............................................5 1.6 Webserver................................................6 2 Writing Tests for PHPUnit 7 2.1 Test Dependencies............................................8 2.2 Data Providers.............................................. 11 2.3 Testing Exceptions............................................ 17 2.4 Testing PHP Errors, Warnings, and Notices............................... 17 2.5 Testing Output.............................................. 20 2.6 Error output............................................... 21 2.6.1 Edge Cases........................................... 23 3 The Command-Line Test Runner 25 3.1 Command-Line Options......................................... 26 3.2 TestDox.................................................. 32 4 Fixtures 35 4.1 More setUp() than tearDown()...................................... 38 4.2 Variations................................................. 38 4.3 Sharing Fixture.............................................. 38 4.4 Global State..............................................
    [Show full text]
  • Secure PHP Development Handbook PHP Security Community of Practice Revision V1.0
    Queen's Secure PHP Development Handbook PHP Security Community of Practice Revision v1.0 Table of Contents • Queen's Secure PHP Development Handbook • Table of Contents • Introduction o Document Scope o How To Contribute o About The Authors . Document Contributors • PHP Configuration o Prerequisites o Development Environment . Workspace Recommendations . Source Control . Subversion Client Setup o Code Commenting . Special Considerations . php.ini o Production Environment . Special Considerations . php.ini • University Standards o Authentication o Database Connectivity . Connecting to Student Data Warehouse . Connecting to Human Resources o Online Payments • Application Design . Definition . Model . View . Controller . Implementation • Application Testing o Security Auditing and Penetration Testing o Testing for New Applications o Testing for Existing Applications / Commercial Software • Security Vulnerabilities o CSRF (Cross Site Request Forgeries) Attacks . Description . Example . Prevention o Remote Code Execution . Description . Example . Prevention o SQL Injection Vulnerabilities . Description . Example . Prevention . References o Format String Vulnerabilities . Description . Example . Prevention . References o XSS (Cross Site Scripting) Vulnerabilities . Description . Example . Prevention • Conclusion • Appendices Introduction This document provides recommendations and security best practices for PHP development at Queen's University. The primary goal of this document is to provide a snap shot of current recommendations for PHP developers
    [Show full text]
  • Phpunit Manual Version Latest
    PHPUnit Manual Version latest Sebastian Bergmann sept. 07, 2021 Table des matières 1 Installer PHPUnit 3 1.1 Pré-requis.................................................3 1.2 PHP Archive (PHAR)..........................................3 1.2.1 Windows............................................4 1.2.2 Vérification des versions PHAR de PHPUnit.........................4 1.3 Composer.................................................6 1.4 Paquets optionnels............................................6 2 Écrire des tests pour PHPUnit9 2.1 Dépendances des tests.......................................... 10 2.2 Fournisseur de données......................................... 13 2.3 Tester des exceptions........................................... 18 2.4 Tester les erreurs PHP.......................................... 19 2.5 Tester la sortie écran........................................... 21 2.6 Sortie d’erreur.............................................. 22 2.6.1 Cas limite............................................ 24 3 Lanceur de tests en ligne de commandes 27 3.1 Options de la ligne de commandes.................................... 28 3.2 TestDox.................................................. 34 4 Fixtures 35 4.1 Plus de setUp() que de tearDown().................................... 38 4.2 Variantes................................................. 38 4.3 Partager les Fixtures........................................... 38 4.4 Etat global................................................ 39 5 Organiser les tests 41 5.1 Composer une suite de tests
    [Show full text]