Skip to content

Debugging using Controller and routes.xml

License

Notifications You must be signed in to change notification settings

lastralab/Magento2-TestUnit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Magento2-TestUnit

Implementation

  • Download/clone repo.
  • Copy the folder Lastra/ to your app/code/ directory in Magento.
  • Replace code in View Model according to your needs.
  • In your Magento root directory run:
    sudo rm -rf generated/*;
    magento mod:en Lastra_Testing
    magento c:c
  • Turn on your debug tool.
  • Add breakpoints.
  • Add /in_a_galaxy/far/faraway to your browser, after your localhost url.

Using Xdebug with PhpStorm and Docker

As root and use bash:

mkdir /tmp/downloads; \
    wget -O /tmp/downloads/xdebug-2.6.1.tgz https://xdebug.org/files/xdebug-2.6.1.tgz; \
    cd /tmp/downloads; \
    tar -xvzf /tmp/downloads/xdebug-2.6.1.tgz; \
    cd /tmp/downloads/xdebug-2.6.1; \
    phpize; \
    ./configure && make; \
    cp /tmp/downloads/xdebug-2.6.1/modules/xdebug.so /usr/lib/php/20170718/; \
    rm -r /tmp/downloads;

apt-get install php-xdebug;

In file /etc/php/7.2/mods-available/xdebug.ini insert:

zend_extension = /usr/lib/php/20170718/xdebug.so
xdebug.remote_autostart = 1
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.ide_key = PHPSTORM
xdebug.remote_mode = req
xdebug.remote_port = 9000
xdebug.remote_connect_back = 1
  • Set configurations in PhpStorm

    • Language
      • Screen Shot 2020-06-10 at 12 39 03 PM
    • Server
      • Screen Shot 2020-06-10 at 12 41 53 PM
    • Debug Config
      • Screen Shot 2020-06-10 at 12 42 04 PM
  • Add Xdebug Helper extension to browser

    • Screen Shot 2020-06-10 at 12 44 34 PM

About

Debugging using Controller and routes.xml

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published