SlideShare a Scribd company logo
Xdebug with PHPUnit 
In Drupal 8
About me
Intro: XDebug 
Depuración en PHP: 
● print_r(), var_dump(), … 
● FirePHP 
● Kint , Krumo, Ladybug 
● phpdbg incluido ya en 5.6
Intro: XDebug 
● Debugging and profiling PHP extension 
● Show log trace information 
● Allow step by step debugging 
More info
Intro: XDebug - My experience 
I feel secure on my own!!! 
but 
It’s not the holy grail
Xdebug installation + configuration: 
PHP extension 
+ 
System configuration 
+ 
IDE configuration 
+ 
Browser configuration
Xdebug installation: PHP extension 
sudo apt-get install php5-xdebug 
http://xdebug.org/docs/install
Xdebug installation: System configuration 
/etc/php5/apache2/php.ini AND/OR /etc/php5/cli/php.ini 
● zend_extension="/usr/lib/php5/20121212/xdebug.so" 
● xdebug.remote_enable=1 
● xdebug.remote_host= IDE host 
● xdebug.remote_port="9000" 
● xdebug.profiler_enable=1 
● xdebug.profiler_output_dir="/tmp" 
● xdebug.idekey="drupal8"
How do we check it? 
Web: echo phpinfo();
Xdebug installation: How do we check it? 
Console (cli): php -v & php -i | grep remote
IDE configuration 
● Set Xdebug in PhpStorm 
● Add a Php remote debug / Php Unit instance 
in PhpStorm 
● Set session id (ide key)
IDE configuration: Set XDebug 
● Configure Php debug 
● Configure server
IDE configuration: Debug instance 
Open Debug panel pressing F9 and select 
Edit configuration 
Add new PHP Remote Debug instance 
Set the ide key (session id) 
and server
Browser configuration 
● The IDE needs an Id to start the debug 
● The browser provides the Id (session_id) 
● Chrome / Firefox extension to provide Id 
○ Xdebug helper
Use case : Debug code (I) 
Environment configuration: 
● Drupal 8 installed in local 
● XDebug installed in local 
● PhpStorm configured with an instance 
Use case: 
● Add breakpoint in code 
● Run debug mode 
● Navigate to stop in the breakpoint 
This is my day by day use of XDebug.
Use case : Debug code (II) 
Environment configuration: 
● Drupal 8 installed in remote environment (vagrant) 
● XDebug installed in remote environment (vagrant) 
● PhpStorm configured with a sync code to remote env. 
Use case: 
● Add breakpoint in code 
● Run debug mode 
● Navigate to stop in the breakpoint 
This is @LuisGonRod day by day use of XDebug.
Use case : Debug code (III) 
Question: What if @LuisGonRod and me want debug in the same remote 
environment? 
http://derickrethans.nl/debugging-with-multiple-users.html
Use case : Debug code (III)
Use case : Debug tests (I) 
Environment configuration: 
● Drupal 8 installed in local 
● XDebug installed in local 
● PhpStorm configured with an instance 
Running test by using browser 
● Activate module Testing 
● Run test DrupalnodeTestsPageEditTest 
Use case 
● Add breakpoint in test code 
● Run debug mode 
● Run test and wait to stop in breakpoint 
Sometimes never stop...at least for me
Use case : Debug tests (II) 
Environment configuration: 
● Drupal 8 installed in local 
● XDebug installed in local 
● PhpStorm configured with an instance 
Running test by using Php cli 
● Activate module Testing 
● Run test using 
○ run-tests.sh script 
○ drush test-run
Use case : Debug tests - run-tests.sh (III) 
XDEBUG_CONFIG="idekey=drupal8" sudo php core/scripts/run-tests.sh --php 
/usr/bin/php --url http://local.drupal --class "DrupalnodeTestsPageEditTest" 
For me it’s not working, right now :( 
configuring the script using PhpStorm it works
Use case : Debug tests - run-tests.sh (IV) 
● Go to debug configuration (F9) 
● Add a Php Script instance 
● Configure it 
○ File: path to run-tests.sh 
○ Arguments: The run-tests parameters 
○ Environment variables: XDEBUG_CONFIG with idekey
Use case : Debug tests - drush test-run (V) 
drush test-run --uri= local.drupal DrupalnodeTestsPageEditTest
...And what about PHPUnit? 
We can debug PHPUnit tests using Phpstorm adding a PHPUnit or PHPUnit on server 
instance
what about PHPUnit and php cli? 
We can run test through runt-tests.sh script or 
php scripts/run-tests.sh --php /usr/bin/php PHPUnit
And now...what?
Do you know why we have moustache? 
● Configuraciones especiales de Xdebug 
● Si lanzamos los test por consola no tenemos 
la cookie del navegador.
Movember and Drupal community 
If you can, please, donate. 
you won’t be the only one, maybe in that room 
you find some moustaches in @jose_lakatos 
@jsbalsera @penyaskito and @gloob 
http://es.movember.com/en/team/1674337 
http://es.movember.com/mospace/10983485

More Related Content

What's hot

IntroJs
IntroJsIntroJs
Testing in go
Testing in goTesting in go
Diagnosing WordPress: What to do when things go wrong
Diagnosing WordPress: What to do when things go wrongDiagnosing WordPress: What to do when things go wrong
Diagnosing WordPress: What to do when things go wrong
WordCamp Sydney
 
Module, AMD, RequireJS
Module, AMD, RequireJSModule, AMD, RequireJS
Module, AMD, RequireJS偉格 高
 
GTAC Boosting your Testing Productivity with Groovy
GTAC Boosting your Testing Productivity with GroovyGTAC Boosting your Testing Productivity with Groovy
GTAC Boosting your Testing Productivity with Groovy
Andres Almiray
 
Browser-Based testing using Selenium
Browser-Based testing using SeleniumBrowser-Based testing using Selenium
Browser-Based testing using Seleniumret0
 
TDD for Javascript developers
TDD for Javascript developersTDD for Javascript developers
TDD for Javascript developers
Andrey Kucherenko
 
cf.Objective() 2017 - Design patterns - Brad Wood
cf.Objective() 2017 - Design patterns - Brad Woodcf.Objective() 2017 - Design patterns - Brad Wood
cf.Objective() 2017 - Design patterns - Brad Wood
Ortus Solutions, Corp
 
Grooscript greach 2015
Grooscript greach 2015Grooscript greach 2015
Grooscript greach 2015
Jorge Franco Leza
 
Backbone.js
Backbone.jsBackbone.js
Backbone.js
Omnia Helmi
 
淺談 Groovy 與 AWS 雲端應用開發整合
淺談 Groovy 與 AWS 雲端應用開發整合淺談 Groovy 與 AWS 雲端應用開發整合
淺談 Groovy 與 AWS 雲端應用開發整合
Kyle Lin
 
Grooscript gr8conf 2015
Grooscript gr8conf 2015Grooscript gr8conf 2015
Grooscript gr8conf 2015
Jorge Franco Leza
 
Who’s afraid of WinDbg
Who’s afraid of WinDbgWho’s afraid of WinDbg
Who’s afraid of WinDbg
Dror Helper
 
Efficient JavaScript Unit Testing, May 2012
Efficient JavaScript Unit Testing, May 2012Efficient JavaScript Unit Testing, May 2012
Efficient JavaScript Unit Testing, May 2012
Hazem Saleh
 
Debugging NET Applications With WinDBG
Debugging  NET Applications With WinDBGDebugging  NET Applications With WinDBG
Debugging NET Applications With WinDBG
Cory Foy
 
Developing large scale JavaScript applications
Developing large scale JavaScript applicationsDeveloping large scale JavaScript applications
Developing large scale JavaScript applications
Milan Korsos
 
Taiko presentation
Taiko presentationTaiko presentation
Taiko presentation
VodqaBLR
 
One step in the future: CSS variables
One step in the future: CSS variablesOne step in the future: CSS variables
One step in the future: CSS variables
Giacomo Zinetti
 

What's hot (20)

IntroJs
IntroJsIntroJs
IntroJs
 
Testing in go
Testing in goTesting in go
Testing in go
 
Diagnosing WordPress: What to do when things go wrong
Diagnosing WordPress: What to do when things go wrongDiagnosing WordPress: What to do when things go wrong
Diagnosing WordPress: What to do when things go wrong
 
Js unit testing
Js unit testingJs unit testing
Js unit testing
 
Module, AMD, RequireJS
Module, AMD, RequireJSModule, AMD, RequireJS
Module, AMD, RequireJS
 
GTAC Boosting your Testing Productivity with Groovy
GTAC Boosting your Testing Productivity with GroovyGTAC Boosting your Testing Productivity with Groovy
GTAC Boosting your Testing Productivity with Groovy
 
Browser-Based testing using Selenium
Browser-Based testing using SeleniumBrowser-Based testing using Selenium
Browser-Based testing using Selenium
 
TDD for Javascript developers
TDD for Javascript developersTDD for Javascript developers
TDD for Javascript developers
 
cf.Objective() 2017 - Design patterns - Brad Wood
cf.Objective() 2017 - Design patterns - Brad Woodcf.Objective() 2017 - Design patterns - Brad Wood
cf.Objective() 2017 - Design patterns - Brad Wood
 
Grooscript greach 2015
Grooscript greach 2015Grooscript greach 2015
Grooscript greach 2015
 
Backbone.js
Backbone.jsBackbone.js
Backbone.js
 
淺談 Groovy 與 AWS 雲端應用開發整合
淺談 Groovy 與 AWS 雲端應用開發整合淺談 Groovy 與 AWS 雲端應用開發整合
淺談 Groovy 與 AWS 雲端應用開發整合
 
Grooscript gr8conf 2015
Grooscript gr8conf 2015Grooscript gr8conf 2015
Grooscript gr8conf 2015
 
Lviv 2013 d7 vs d8
Lviv 2013   d7 vs d8Lviv 2013   d7 vs d8
Lviv 2013 d7 vs d8
 
Who’s afraid of WinDbg
Who’s afraid of WinDbgWho’s afraid of WinDbg
Who’s afraid of WinDbg
 
Efficient JavaScript Unit Testing, May 2012
Efficient JavaScript Unit Testing, May 2012Efficient JavaScript Unit Testing, May 2012
Efficient JavaScript Unit Testing, May 2012
 
Debugging NET Applications With WinDBG
Debugging  NET Applications With WinDBGDebugging  NET Applications With WinDBG
Debugging NET Applications With WinDBG
 
Developing large scale JavaScript applications
Developing large scale JavaScript applicationsDeveloping large scale JavaScript applications
Developing large scale JavaScript applications
 
Taiko presentation
Taiko presentationTaiko presentation
Taiko presentation
 
One step in the future: CSS variables
One step in the future: CSS variablesOne step in the future: CSS variables
One step in the future: CSS variables
 

Viewers also liked

D8 configuration migration
D8 configuration migrationD8 configuration migration
D8 configuration migrationViktor Likin
 
Dcmi v likin kyiv 2013
Dcmi v likin kyiv 2013Dcmi v likin kyiv 2013
Dcmi v likin kyiv 2013Viktor Likin
 
Продвинутый мультисайтинг
Продвинутый мультисайтингПродвинутый мультисайтинг
Продвинутый мультисайтингDrupal Camp Kyiv
 
Managing Drupal on Windows with Drush
Managing Drupal on Windows with DrushManaging Drupal on Windows with Drush
Managing Drupal on Windows with Drush
Alessandro Pilotti
 
Drush installation guide
Drush installation guideDrush installation guide
Drush installation guideThierno Fall
 
Drush workshop
Drush workshopDrush workshop
Drush workshop
Juampy NR
 
[Srijan Wednesday Webinar] Mastering Drupal 8 Development with Drupal Console
[Srijan Wednesday Webinar] Mastering Drupal 8 Development with Drupal Console[Srijan Wednesday Webinar] Mastering Drupal 8 Development with Drupal Console
[Srijan Wednesday Webinar] Mastering Drupal 8 Development with Drupal Console
Srijan Technologies
 
Drupal, Memcache and Solr on Windows
Drupal, Memcache and Solr on WindowsDrupal, Memcache and Solr on Windows
Drupal, Memcache and Solr on Windows
Alessandro Pilotti
 
Getting started with Drupal 8
Getting started with Drupal 8Getting started with Drupal 8
Getting started with Drupal 8
Hector Iribarne
 
Drupal 6 to Drupal 8 Migration
Drupal 6 to Drupal 8 MigrationDrupal 6 to Drupal 8 Migration
Drupal 6 to Drupal 8 Migration
Ameex Technologies
 
Composer tools and frameworks for drupal.ppt
Composer tools and frameworks for drupal.pptComposer tools and frameworks for drupal.ppt
Composer tools and frameworks for drupal.ppt
Promet Source
 
Drush for humans - SANDcamp 2013
Drush for humans - SANDcamp 2013Drush for humans - SANDcamp 2013
Drush for humans - SANDcamp 2013
Jon Peck
 
Drush Presentation
Drush PresentationDrush Presentation
Drush Presentation
perceptum
 
Drush and drupal. администрирование. Волчек Михаил
Drush and drupal. администрирование. Волчек МихаилDrush and drupal. администрирование. Волчек Михаил
Drush and drupal. администрирование. Волчек МихаилPVasili
 
Composer Tools & Frameworks for Drupal
Composer Tools & Frameworks for DrupalComposer Tools & Frameworks for Drupal
Composer Tools & Frameworks for Drupal
Pantheon
 
Depolying Drupal with Git, Drush Make and Capistrano
Depolying Drupal with Git, Drush Make and CapistranoDepolying Drupal with Git, Drush Make and Capistrano
Depolying Drupal with Git, Drush Make and Capistranolibsys
 
Drush - use full power - DrupalCamp Donetsk 2014
Drush - use full power - DrupalCamp Donetsk 2014Drush - use full power - DrupalCamp Donetsk 2014
Drush - use full power - DrupalCamp Donetsk 2014
Alex S
 
[drupalday2017] - DevOps: strumenti di automazione per Drupal8
[drupalday2017] - DevOps: strumenti di automazione per Drupal8[drupalday2017] - DevOps: strumenti di automazione per Drupal8
[drupalday2017] - DevOps: strumenti di automazione per Drupal8
DrupalDay
 
5 Important Tools for Drupal Development
5 Important Tools for Drupal Development5 Important Tools for Drupal Development
5 Important Tools for Drupal Developmentjcarrig
 

Viewers also liked (19)

D8 configuration migration
D8 configuration migrationD8 configuration migration
D8 configuration migration
 
Dcmi v likin kyiv 2013
Dcmi v likin kyiv 2013Dcmi v likin kyiv 2013
Dcmi v likin kyiv 2013
 
Продвинутый мультисайтинг
Продвинутый мультисайтингПродвинутый мультисайтинг
Продвинутый мультисайтинг
 
Managing Drupal on Windows with Drush
Managing Drupal on Windows with DrushManaging Drupal on Windows with Drush
Managing Drupal on Windows with Drush
 
Drush installation guide
Drush installation guideDrush installation guide
Drush installation guide
 
Drush workshop
Drush workshopDrush workshop
Drush workshop
 
[Srijan Wednesday Webinar] Mastering Drupal 8 Development with Drupal Console
[Srijan Wednesday Webinar] Mastering Drupal 8 Development with Drupal Console[Srijan Wednesday Webinar] Mastering Drupal 8 Development with Drupal Console
[Srijan Wednesday Webinar] Mastering Drupal 8 Development with Drupal Console
 
Drupal, Memcache and Solr on Windows
Drupal, Memcache and Solr on WindowsDrupal, Memcache and Solr on Windows
Drupal, Memcache and Solr on Windows
 
Getting started with Drupal 8
Getting started with Drupal 8Getting started with Drupal 8
Getting started with Drupal 8
 
Drupal 6 to Drupal 8 Migration
Drupal 6 to Drupal 8 MigrationDrupal 6 to Drupal 8 Migration
Drupal 6 to Drupal 8 Migration
 
Composer tools and frameworks for drupal.ppt
Composer tools and frameworks for drupal.pptComposer tools and frameworks for drupal.ppt
Composer tools and frameworks for drupal.ppt
 
Drush for humans - SANDcamp 2013
Drush for humans - SANDcamp 2013Drush for humans - SANDcamp 2013
Drush for humans - SANDcamp 2013
 
Drush Presentation
Drush PresentationDrush Presentation
Drush Presentation
 
Drush and drupal. администрирование. Волчек Михаил
Drush and drupal. администрирование. Волчек МихаилDrush and drupal. администрирование. Волчек Михаил
Drush and drupal. администрирование. Волчек Михаил
 
Composer Tools & Frameworks for Drupal
Composer Tools & Frameworks for DrupalComposer Tools & Frameworks for Drupal
Composer Tools & Frameworks for Drupal
 
Depolying Drupal with Git, Drush Make and Capistrano
Depolying Drupal with Git, Drush Make and CapistranoDepolying Drupal with Git, Drush Make and Capistrano
Depolying Drupal with Git, Drush Make and Capistrano
 
Drush - use full power - DrupalCamp Donetsk 2014
Drush - use full power - DrupalCamp Donetsk 2014Drush - use full power - DrupalCamp Donetsk 2014
Drush - use full power - DrupalCamp Donetsk 2014
 
[drupalday2017] - DevOps: strumenti di automazione per Drupal8
[drupalday2017] - DevOps: strumenti di automazione per Drupal8[drupalday2017] - DevOps: strumenti di automazione per Drupal8
[drupalday2017] - DevOps: strumenti di automazione per Drupal8
 
5 Important Tools for Drupal Development
5 Important Tools for Drupal Development5 Important Tools for Drupal Development
5 Important Tools for Drupal Development
 

Similar to Xdebug and Drupal8 tests (PhpUnit and Simpletest)

Xdebug as a Drupal debugging tool
Xdebug as a Drupal debugging toolXdebug as a Drupal debugging tool
Xdebug as a Drupal debugging tool
Vladimir Melnic
 
Xdebug from a to x
Xdebug from a to xXdebug from a to x
Xdebug from a to x
Gennady Feldman
 
Modernize Your Drupal Development
Modernize Your Drupal DevelopmentModernize Your Drupal Development
Modernize Your Drupal DevelopmentChris Tankersley
 
Debugging PHP with xDebug inside of Eclipse PDT 2.1
Debugging PHP with xDebug inside of Eclipse PDT 2.1Debugging PHP with xDebug inside of Eclipse PDT 2.1
Debugging PHP with xDebug inside of Eclipse PDT 2.1
Bastian Feder
 
Debugging Drupal with Xdebug
Debugging Drupal with XdebugDebugging Drupal with Xdebug
Debugging Drupal with Xdebug
Frank Carey
 
Becoming A Drupal Master Builder
Becoming A Drupal Master BuilderBecoming A Drupal Master Builder
Becoming A Drupal Master Builder
Philip Norton
 
Speed up your development environment PHP + Nginx + Fedora + PG
Speed up your development environment PHP + Nginx + Fedora + PGSpeed up your development environment PHP + Nginx + Fedora + PG
Speed up your development environment PHP + Nginx + Fedora + PGMarcus Sá
 
Drupal + composer = new love !?
Drupal + composer = new love !?Drupal + composer = new love !?
Drupal + composer = new love !?
nuppla
 
Xdebug
XdebugXdebug
Xdebug
Bryce Embry
 
Xdebug for Beginners
Xdebug for BeginnersXdebug for Beginners
Xdebug for Beginners
Sean Prunka
 
Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016
Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016
Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016
Paul McKibben
 
Best Practices in PHP Application Deployment
Best Practices in PHP Application DeploymentBest Practices in PHP Application Deployment
Best Practices in PHP Application Deployment
Shahar Evron
 
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios CoreNagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
Nagios
 
Debugging and Profiling PHP Applications
Debugging and Profiling PHP ApplicationsDebugging and Profiling PHP Applications
Debugging and Profiling PHP Applications
Logan Lindquist
 
Xdebug - Derick Rethans - Barcelona PHP Conference 2008
Xdebug - Derick Rethans - Barcelona PHP Conference 2008Xdebug - Derick Rethans - Barcelona PHP Conference 2008
Xdebug - Derick Rethans - Barcelona PHP Conference 2008phpbarcelona
 
PHP BASIC PRESENTATION
PHP BASIC PRESENTATIONPHP BASIC PRESENTATION
PHP BASIC PRESENTATION
krutitrivedi
 
Introduction to Xdebug
Introduction to XdebugIntroduction to Xdebug
Introduction to Xdebug
Abid Malik
 
Creating a Mature Puppet System
Creating a Mature Puppet SystemCreating a Mature Puppet System
Creating a Mature Puppet System
Puppet
 
Creating a mature puppet system
Creating a mature puppet systemCreating a mature puppet system
Creating a mature puppet systemrkhatibi
 

Similar to Xdebug and Drupal8 tests (PhpUnit and Simpletest) (20)

Xdebug as a Drupal debugging tool
Xdebug as a Drupal debugging toolXdebug as a Drupal debugging tool
Xdebug as a Drupal debugging tool
 
Xdebug from a to x
Xdebug from a to xXdebug from a to x
Xdebug from a to x
 
Modernize Your Drupal Development
Modernize Your Drupal DevelopmentModernize Your Drupal Development
Modernize Your Drupal Development
 
Debugging PHP with xDebug inside of Eclipse PDT 2.1
Debugging PHP with xDebug inside of Eclipse PDT 2.1Debugging PHP with xDebug inside of Eclipse PDT 2.1
Debugging PHP with xDebug inside of Eclipse PDT 2.1
 
Debugging Drupal with Xdebug
Debugging Drupal with XdebugDebugging Drupal with Xdebug
Debugging Drupal with Xdebug
 
Becoming A Drupal Master Builder
Becoming A Drupal Master BuilderBecoming A Drupal Master Builder
Becoming A Drupal Master Builder
 
Speed up your development environment PHP + Nginx + Fedora + PG
Speed up your development environment PHP + Nginx + Fedora + PGSpeed up your development environment PHP + Nginx + Fedora + PG
Speed up your development environment PHP + Nginx + Fedora + PG
 
Drupal + composer = new love !?
Drupal + composer = new love !?Drupal + composer = new love !?
Drupal + composer = new love !?
 
Xdebug
XdebugXdebug
Xdebug
 
Xdebug for Beginners
Xdebug for BeginnersXdebug for Beginners
Xdebug for Beginners
 
Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016
Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016
Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016
 
Best Practices in PHP Application Deployment
Best Practices in PHP Application DeploymentBest Practices in PHP Application Deployment
Best Practices in PHP Application Deployment
 
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios CoreNagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
 
Debugging and Profiling PHP Applications
Debugging and Profiling PHP ApplicationsDebugging and Profiling PHP Applications
Debugging and Profiling PHP Applications
 
Xdebug - Derick Rethans - Barcelona PHP Conference 2008
Xdebug - Derick Rethans - Barcelona PHP Conference 2008Xdebug - Derick Rethans - Barcelona PHP Conference 2008
Xdebug - Derick Rethans - Barcelona PHP Conference 2008
 
Neo4j Graph Database, from PHP
Neo4j Graph Database, from PHPNeo4j Graph Database, from PHP
Neo4j Graph Database, from PHP
 
PHP BASIC PRESENTATION
PHP BASIC PRESENTATIONPHP BASIC PRESENTATION
PHP BASIC PRESENTATION
 
Introduction to Xdebug
Introduction to XdebugIntroduction to Xdebug
Introduction to Xdebug
 
Creating a Mature Puppet System
Creating a Mature Puppet SystemCreating a Mature Puppet System
Creating a Mature Puppet System
 
Creating a mature puppet system
Creating a mature puppet systemCreating a mature puppet system
Creating a mature puppet system
 

Recently uploaded

De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
Jelle | Nordend
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
Peter Caitens
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024
Sharepoint Designs
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Hivelance Technology
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
Ortus Solutions, Corp
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
NaapbooksPrivateLimi
 
Software Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdfSoftware Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdf
MayankTawar1
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Anthony Dahanne
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
WSO2
 
Strategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptxStrategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptx
varshanayak241
 

Recently uploaded (20)

De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
 
Software Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdfSoftware Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdf
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
Strategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptxStrategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptx
 

Xdebug and Drupal8 tests (PhpUnit and Simpletest)

  • 1. Xdebug with PHPUnit In Drupal 8
  • 3. Intro: XDebug Depuración en PHP: ● print_r(), var_dump(), … ● FirePHP ● Kint , Krumo, Ladybug ● phpdbg incluido ya en 5.6
  • 4. Intro: XDebug ● Debugging and profiling PHP extension ● Show log trace information ● Allow step by step debugging More info
  • 5. Intro: XDebug - My experience I feel secure on my own!!! but It’s not the holy grail
  • 6. Xdebug installation + configuration: PHP extension + System configuration + IDE configuration + Browser configuration
  • 7. Xdebug installation: PHP extension sudo apt-get install php5-xdebug http://xdebug.org/docs/install
  • 8. Xdebug installation: System configuration /etc/php5/apache2/php.ini AND/OR /etc/php5/cli/php.ini ● zend_extension="/usr/lib/php5/20121212/xdebug.so" ● xdebug.remote_enable=1 ● xdebug.remote_host= IDE host ● xdebug.remote_port="9000" ● xdebug.profiler_enable=1 ● xdebug.profiler_output_dir="/tmp" ● xdebug.idekey="drupal8"
  • 9. How do we check it? Web: echo phpinfo();
  • 10. Xdebug installation: How do we check it? Console (cli): php -v & php -i | grep remote
  • 11. IDE configuration ● Set Xdebug in PhpStorm ● Add a Php remote debug / Php Unit instance in PhpStorm ● Set session id (ide key)
  • 12. IDE configuration: Set XDebug ● Configure Php debug ● Configure server
  • 13. IDE configuration: Debug instance Open Debug panel pressing F9 and select Edit configuration Add new PHP Remote Debug instance Set the ide key (session id) and server
  • 14. Browser configuration ● The IDE needs an Id to start the debug ● The browser provides the Id (session_id) ● Chrome / Firefox extension to provide Id ○ Xdebug helper
  • 15. Use case : Debug code (I) Environment configuration: ● Drupal 8 installed in local ● XDebug installed in local ● PhpStorm configured with an instance Use case: ● Add breakpoint in code ● Run debug mode ● Navigate to stop in the breakpoint This is my day by day use of XDebug.
  • 16. Use case : Debug code (II) Environment configuration: ● Drupal 8 installed in remote environment (vagrant) ● XDebug installed in remote environment (vagrant) ● PhpStorm configured with a sync code to remote env. Use case: ● Add breakpoint in code ● Run debug mode ● Navigate to stop in the breakpoint This is @LuisGonRod day by day use of XDebug.
  • 17. Use case : Debug code (III) Question: What if @LuisGonRod and me want debug in the same remote environment? http://derickrethans.nl/debugging-with-multiple-users.html
  • 18. Use case : Debug code (III)
  • 19. Use case : Debug tests (I) Environment configuration: ● Drupal 8 installed in local ● XDebug installed in local ● PhpStorm configured with an instance Running test by using browser ● Activate module Testing ● Run test DrupalnodeTestsPageEditTest Use case ● Add breakpoint in test code ● Run debug mode ● Run test and wait to stop in breakpoint Sometimes never stop...at least for me
  • 20. Use case : Debug tests (II) Environment configuration: ● Drupal 8 installed in local ● XDebug installed in local ● PhpStorm configured with an instance Running test by using Php cli ● Activate module Testing ● Run test using ○ run-tests.sh script ○ drush test-run
  • 21. Use case : Debug tests - run-tests.sh (III) XDEBUG_CONFIG="idekey=drupal8" sudo php core/scripts/run-tests.sh --php /usr/bin/php --url http://local.drupal --class "DrupalnodeTestsPageEditTest" For me it’s not working, right now :( configuring the script using PhpStorm it works
  • 22. Use case : Debug tests - run-tests.sh (IV) ● Go to debug configuration (F9) ● Add a Php Script instance ● Configure it ○ File: path to run-tests.sh ○ Arguments: The run-tests parameters ○ Environment variables: XDEBUG_CONFIG with idekey
  • 23. Use case : Debug tests - drush test-run (V) drush test-run --uri= local.drupal DrupalnodeTestsPageEditTest
  • 24. ...And what about PHPUnit? We can debug PHPUnit tests using Phpstorm adding a PHPUnit or PHPUnit on server instance
  • 25. what about PHPUnit and php cli? We can run test through runt-tests.sh script or php scripts/run-tests.sh --php /usr/bin/php PHPUnit
  • 27. Do you know why we have moustache? ● Configuraciones especiales de Xdebug ● Si lanzamos los test por consola no tenemos la cookie del navegador.
  • 28. Movember and Drupal community If you can, please, donate. you won’t be the only one, maybe in that room you find some moustaches in @jose_lakatos @jsbalsera @penyaskito and @gloob http://es.movember.com/en/team/1674337 http://es.movember.com/mospace/10983485