SlideShare a Scribd company logo
1 of 28
Download to read offline
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

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 wrongWordCamp 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 GroovyAndres 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 developersAndrey 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 WoodOrtus Solutions, Corp
 
淺談 Groovy 與 AWS 雲端應用開發整合
淺談 Groovy 與 AWS 雲端應用開發整合淺談 Groovy 與 AWS 雲端應用開發整合
淺談 Groovy 與 AWS 雲端應用開發整合Kyle Lin
 
Who’s afraid of WinDbg
Who’s afraid of WinDbgWho’s afraid of WinDbg
Who’s afraid of WinDbgDror Helper
 
Efficient JavaScript Unit Testing, May 2012
Efficient JavaScript Unit Testing, May 2012Efficient JavaScript Unit Testing, May 2012
Efficient JavaScript Unit Testing, May 2012Hazem Saleh
 
Debugging NET Applications With WinDBG
Debugging  NET Applications With WinDBGDebugging  NET Applications With WinDBG
Debugging NET Applications With WinDBGCory Foy
 
Developing large scale JavaScript applications
Developing large scale JavaScript applicationsDeveloping large scale JavaScript applications
Developing large scale JavaScript applicationsMilan Korsos
 
Taiko presentation
Taiko presentationTaiko presentation
Taiko presentationVodqaBLR
 
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 variablesGiacomo 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 DrushAlessandro Pilotti
 
Drush installation guide
Drush installation guideDrush installation guide
Drush installation guideThierno Fall
 
Drush workshop
Drush workshopDrush workshop
Drush workshopJuampy 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 ConsoleSrijan Technologies
 
Drupal, Memcache and Solr on Windows
Drupal, Memcache and Solr on WindowsDrupal, Memcache and Solr on Windows
Drupal, Memcache and Solr on WindowsAlessandro Pilotti
 
Getting started with Drupal 8
Getting started with Drupal 8Getting started with Drupal 8
Getting started with Drupal 8Hector Iribarne
 
Drupal 6 to Drupal 8 Migration
Drupal 6 to Drupal 8 MigrationDrupal 6 to Drupal 8 Migration
Drupal 6 to Drupal 8 MigrationAmeex 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.pptPromet Source
 
Drush for humans - SANDcamp 2013
Drush for humans - SANDcamp 2013Drush for humans - SANDcamp 2013
Drush for humans - SANDcamp 2013Jon Peck
 
Drush Presentation
Drush PresentationDrush Presentation
Drush Presentationperceptum
 
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 DrupalPantheon
 
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 2014Alex 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 Drupal8DrupalDay
 
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 with PHPUnit in Drupal 8

Xdebug as a Drupal debugging tool
Xdebug as a Drupal debugging toolXdebug as a Drupal debugging tool
Xdebug as a Drupal debugging toolVladimir Melnic
 
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.1Bastian Feder
 
Debugging Drupal with Xdebug
Debugging Drupal with XdebugDebugging Drupal with Xdebug
Debugging Drupal with XdebugFrank Carey
 
Becoming A Drupal Master Builder
Becoming A Drupal Master BuilderBecoming A Drupal Master Builder
Becoming A Drupal Master BuilderPhilip 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 for Beginners
Xdebug for BeginnersXdebug for Beginners
Xdebug for BeginnersSean 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 2016Paul McKibben
 
Best Practices in PHP Application Deployment
Best Practices in PHP Application DeploymentBest Practices in PHP Application Deployment
Best Practices in PHP Application DeploymentShahar 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 CoreNagios
 
Debugging and Profiling PHP Applications
Debugging and Profiling PHP ApplicationsDebugging and Profiling PHP Applications
Debugging and Profiling PHP ApplicationsLogan 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 PRESENTATIONkrutitrivedi
 
Introduction to Xdebug
Introduction to XdebugIntroduction to Xdebug
Introduction to XdebugAbid Malik
 
Creating a mature puppet system
Creating a mature puppet systemCreating a mature puppet system
Creating a mature puppet systemrkhatibi
 
Creating a Mature Puppet System
Creating a Mature Puppet SystemCreating a Mature Puppet System
Creating a Mature Puppet SystemPuppet
 

Similar to Xdebug with PHPUnit in Drupal 8 (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

SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptcpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptrcbcrtm
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Software Coding for software engineering
Software Coding for software engineeringSoftware Coding for software engineering
Software Coding for software engineeringssuserb3a23b
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 

Recently uploaded (20)

SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptcpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.ppt
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Software Coding for software engineering
Software Coding for software engineeringSoftware Coding for software engineering
Software Coding for software engineering
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 

Xdebug with PHPUnit in Drupal 8

  • 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