Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jan 23 22:32
    webignition closed #4025
  • Jan 23 22:32
    webignition commented #4025
  • Jan 23 20:16
    sebastianbergmann commented #4025
  • Jan 23 19:21
    webignition labeled #4025
  • Jan 23 19:21
    webignition opened #4025
  • Jan 23 16:51
    staabm commented #3162
  • Jan 23 16:45
    sebastianbergmann commented #3162
  • Jan 23 16:43
    staabm commented #3162
  • Jan 23 16:08
    sebastianbergmann edited #3914
  • Jan 23 16:00
    codecov[bot] commented #3914
  • Jan 23 16:00
    codecov[bot] commented #3914
  • Jan 23 16:00
    codecov[bot] commented #3914
  • Jan 23 15:59
    codecov[bot] commented #3914
  • Jan 23 15:59
    codecov[bot] commented #3914
  • Jan 23 15:59
    codecov[bot] commented #3914
  • Jan 23 15:59
    codecov[bot] commented #3914
  • Jan 23 15:58
    codecov[bot] commented #3914
  • Jan 23 15:58
    codecov[bot] commented #3914
  • Jan 23 15:58
    codecov[bot] commented #3914
  • Jan 23 15:58
    codecov[bot] commented #3914
Ryein Goddard
@Goddard
yeah just need the plugin, firefox extension, and then enable it on the server
rspiewak47
@rspiewak47
I also have it working in Eclipse.
Ryein Goddard
@Goddard
cool
haven't used eclipse for a long time now...before I always used netbeans for some reason...not sure why..not it is always vscode
rspiewak47
@rspiewak47
Here's what I have for Eclipse setup so far:
Version in use: 2019-09 R (4.13.0)
Configuring Eclipse for Drupal (https://www.drupal.org/docs/develop/development-tools/configuring-eclipse) is a good starting point.
In particular, install the PHP Development Tools (PDT) package: http://www.eclipse.org/pdt/
Configure the PHP Built-in Server at localhost so that it uses a port not conflicting with your Apache server if used, or the localhost (port 80) server if used. http://localhost:8900 works, for example.
In the .ini file for the installed PHP which is used, ensure that the xdebug.remote_autostart parameter is set to 1 or on.
Create a PHP project. Set a launch configuration under Run/Debug Settings in the project properties window by selecting the Built-in Server at localhost and the file that you want to start with as a PHP Web Application. The file should be selected from your project.
On the Debug tab in the left-hand window, select the dropdown and select “Show debug toolbar”.
rspiewak47
@rspiewak47
The key to consistently working in Visual Studio 2019 is also:In the .ini file for the installed PHP which is used, ensure that the xdebug.remote_autostart parameter is set to 1 or on.
Is there a particular trick to setting up the launch configuration in VS Code?
Ryein Goddard
@Goddard
well on mine I have it setup to listen on local host for my linux workstation I develop on so configuration is very minimal, but I imagine if you have another server you are trying to work with then you will need to declare the ip and port at the very least
then your php.ini will need to include the same details
rspiewak47
@rspiewak47
This page has useful information, including the use of the Xdebug Helper Chrome extension. I was able to make it work following this - so far using my Apache installation, but I'm working on getting it to use the PHP built-in server.
Ryein Goddard
@Goddard
yep that is basically what i did to set mine up except i used the firefox extensions haha :D
i never used the built in php server but that would be possibly easier to configure
and duplicate for multiple devs
rspiewak47
@rspiewak47
It looks like VS Code may not have an automatic way to start the built-in server, but I'll keep looking. Otherwise, it may require a manual step or bat file.
rspiewak47
@rspiewak47
So here's an example of using the PHP Built-in server:
PS > cd "C:\Program Files (x86)\Ampps\www\Sample"
PS C:\Program Files (x86)\Ampps\www\Sample> php -S localhost:8900
PHP 7.3.7 Development Server started at Mon Jan 6 13:16:15 2020
Listening on http://localhost:8900
Document root is C:\Program Files (x86)\Ampps\www\Sample
Press Ctrl-C to quit.
Then, using the "Listen for XDebug" launch configuration, it just works.
Nikolay Yotsov
@karborator

Hi
I have same code migrating it from 5.6 to 7.3 and seems is falling , so I decided to ask for help ?

    ...
    this->expectLoggerToLogWarning($this->logicalAnd(....));
    ......


    private function expectLoggerToLogWarning($msg)
    {
        $this->logger
            ->expects($this->once())
            ->method('warning')
            ->with($msg);
    }

5.6
.

Time: 1.14 seconds, Memory: 26.75MB

OK (1 test, 2 assertions)
~~
with 7.3 php

Expectation failed for method name is "warning" when invoked 1 time(s)
Parameter 0 for invocation warning(....) does not match expected value.

Nikolay Yotsov
@karborator
@sebastianbergmann
rspiewak47
@rspiewak47
Trying to run PHPUnit in VSCode, getting:

Executing task in folder PHP Sample 1: php c:/Projects/PHP Sample 1/vendor/phpunit/phpunit/phpunit "c:/Projects/PHP Sample 1/SampleTest.php" <

Could not open input file: c:/Projects/PHP
The terminal process terminated with exit code: 1

Why is it trying to run "php"
I have the path to the php executable I want to use configured.
Ryein Goddard
@Goddard
first path needs quotes
rspiewak47
@rspiewak47
I'm getting 'c:\Projects\PHP' is not recognized as an internal or external command. I don't see where I can modify the source of the command that it's trying to execute.
Ryein Goddard
@Goddard
php "c:/Projects/PHP Sample 1/vendor/phpunit/phpunit/phpunit" "c:/Projects/PHP Sample 1/SampleTest.php"
even with that command?
rspiewak47
@rspiewak47
I'm not entering the command, apparently it's being done internally.
If I enter it manually as you typed it, it runs. I can't figure out what VSCode is doing.
Ideally, I want to run my unit tests with XDebug.
If I follow your lead, and take the command that the task is executing and add the quotes and enter it in a new terminal myself, it runs fine!
rspiewak47
@rspiewak47
Apparently it's interpreting the start of the path, c:/Projects/PHP Sample 1/SampleTest.php, as a command of C:/Projects/PHP
I have to figure out where that's coming from and if I can change it, or if I just have to use a path without spaces.
Ryein Goddard
@Goddard
yeah maybe just need to add quotes
rspiewak47
@rspiewak47
But VSCode is constructing this command - how do I figure out where to add the quotes?
Well, if I run the debugger under "Listen for XDebug" and then enter the phpUnit command with quotes myself, I hit my breakpoint!
So if I can figure out where to go to force the quotes, I might not have to do it that way. Or, just use a path without spaces...
Oh - it didn't hit my breakpoint, it hit an exception.
rspiewak47
@rspiewak47
Well, back to the drawing board a bit. I think I'll back off the spaces for now, and then try to figure out how to get a unit test working with XDebug.
Ryein Goddard
@Goddard
you could just remove the spaces from the path and it would work right?
rspiewak47
@rspiewak47
Yes, that part worked. But somehow I've munged this up and nothing is working now. I'll have to walk some things back...
Ryein Goddard
@Goddard
I had to look up the word munged haha
Jeramy
@xylesoft
Good day everyone. Has anyone succesfully mocked Memcached with PHPUnit 8.5?
Jeramy
@xylesoft
For anyone who also might have the same issue as described above, the solution I came up with was using Mockery.
Andrea Bergamasco
@vjandrea
Hello, I'm trying to mark some tests as risky in a Symfony 4.3.9 project using the markAsRisky method, but I can't see any "R" in the testcase output. PhpUnit 8.5.1. Any clue?
HenkPoley
@HenkPoley
@vjandrea possible risky tests are automatically disabled, so you need to explicitly mention them or the risky category for them to run ?
Andrea Bergamasco
@vjandrea
@HenkPoley If i write a test with no assertions I can see that it's automatically marked as Risky and the R appears in the testcase output