PhpStorm: how to use project root variable or relative path in PhpUnit configuration? - phpstorm

I would like to setup PhpUnit in PhpStorm. I press 1. Edit Configurations... and would like to enter this parameter in field 2.
I am using phpunit.xml as configuration file and all want to use a relative path like:
phpunit.xml
or use project root variable like
$PROJECT_ROOT/phpunit.xml
But both options are not working for me.

Based on your screenshot (the place where you want to use it): use full path -- in project settings such path is stored relative to the project root anyway (unless you specify some file which is outside of the project, of course) and the full path then reconstructed when needed (e.g. when shown to you or when used as a parameter during tests execution).

I don't think you'll be able to achieve what you want via the project's Run/Debug configurations. What might help you is the Default configuration file setting in your default project settings, which can be used to define the PHPUnit configuration file to use by default, so you don't need to specify it via the Use alternative configuration file option in your Run/Debug configuration.
To set this, open your Default Settings window, then navigate to Languages & Frameworks -> PHP -> PHPUnit. In the Test Runner section tick the Default configuration file checkbox and specify the location where you keep your configuration file. If this file will always be in the same path relative to your project root, you can use the $PROJECT_DIR$ variable to define the project root. So if your PHPUnit configuration file is always in the root of your project, you might set this to something like $PROJECT_DIR$/phpunit.xml. When you create a new project, its Default configuration file variable will be set to the file offset from your project root, and you won't need to use the Use alternative configuration file option in your Run/Debug configuration.
If you're opening the same project in different locations on the same machine this should work for new projects without any problem, if you want to share this configuration across machines, you might need to try PHPStorm's Exporting and Importing Settings functionality.
I'm not sure if this directly solves your problem, and it's a few months late anyway, but maybe this will be useful for someone else who stumbles across this question... The above instructions were correct for my 8.0.3 installation on Linux.

Related

'gitlab-runner' is not recognized as an internal or external command,

I'm using Windows 10 and installed gitlab-runner using the Gitlab's doc.
After a successful installation and registration, I try to leave the folderI used to install (C:\Gitlab-Runner in my instance) and try to run gitlab-runner. I get the response: 'gitlab-runner' is not recognized as an internal or external command, operable program or batch file.
I am able to run without issue in the C:\Gitlab-Runner folder, but nowhere else.
Based on the documentation and tutorials I looked at, I wouldn't expect this behavior; am I supposed to?
Did you check to ensure that it was added to The windows environment. You will likely need to update the path variable to include the path that you are using to run the command.
On windows, you add to the PATH variable with the following steps (yanked from google search page):
On the Windows taskbar, right-click the Windows icon and select System.
In the Settings window, under Related Settings, click Advanced system settings. ...
On the Advanced tab, click Environment Variables. ...
Click New to create a new environment variable.
Once you've added C:/Gitlab-runner/ to PATH, I believe you should be able to invoke with gitlab-runner.
The only thing I'll add is that, for setting PATH, the last step above is most likely unnecessary, as there will already be a variable named PATH with a list of directories stored in it. Just click EDIT and add your directory to the end of the list. Be sure to add the separator that is used for the others (I believe it's a semicolon on Windows...)
Solved. I need to call C:/Gitlab-runner/gitlab-runner rather than just gitlab-runner in other directories.
Please make sure the name of the exe is correct in the folder C:\GitLab-Runner
In my situation, I have the gilab-runner.exe.exe, there was an extra .exe in the file name though its not showing in the directory.
enter image description here

PhpStorm namespace to Laravel's app directory

I seem to be having an issue with PhpStorm and Laravel, where for some strange reason, every time that I manually create a new class file it uses the app for the beginning of the namespace - even though I've set the app name with artisan. When generating files via artisan - namespace is correct - it's just when I create files manually from within the PhpStorm.
I'm sure it's an easy fix - I just don't quite know where in the settings is the option to update it.
Right click on directory -> Mark directory As -> Sources Root

JBoss - Moving the modules directory around

Wondering if it's possible to move the module directory in a JBoss 7 install to a non-default loco.
Does anyone know of a config param to specify where to pick it up?
Kinda like a conf-dir, bin-dir type of thing.
Thanks,
Aaron.
Yes, it's actually possible. As the documentation states, from within the standard launch scripts users are able to manipulate the module path by setting the $JBOSS_MODULEPATH environment variable. (If not set, $JBOSS_MODULEPATH is set to $JBOSS_HOME/modules). The module path is provided to the running process via the -mp command line argument that is set in the standard scripts.

What is the method or class or whatever that show me the configurations files of JRuby?

I'm new to JRuby, I installed it on windows 8, and I'm following it's wiki. When the wiki said to change a configuration option, it dose not say exactally where I can find the file where the option resides, it gives only its name but not the full path.
So is their a method that I can run on jirb to find the path to any configuration path.
thanks.
The .jrubyrc file is searched in your current directory (user.dir Java property), your home directory (user.home), and since you're on Windows, also in HOMEDRIVE\HOMEPATH, in this order (and the first one wins).

Mercurial win instal: no ini files

I installed mercurial 1.5.1 on win xp but the files listed in hg help config, were not created.
Namely:
%USERPROFILE%.hgrc (is that a valid windows file name?)
%USERPROFILE%\Mercurial.ini
\Mercurial\Mercurial.ini
C:\Mercurial\Mercurial.ini (no such directory altogether)
%HOME%.hgrc (what is this directory)
%HOME%\Mercurial.ini
HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial (no registry created)
.hg\hgrc (i had to create this file manually to solve my problem)
They're not supposed to be automatically created. They're places you can put configuration information depending on what scope you want it to have:
C:\Mercurial\Mercurial.ini - If you choose to create this whatever you put in it affects all users on the systme
%USERPROFILE%\Mercurial.ini - If you choose to create this whatever you put in it affects only you, but in every repo with with you interact
((repository root))\.hg\hgrc - If you choose to create this whatever you put in it affects only the repository in which you placed it
So, it's all about scope. Something like enabling an extension might be best done system global in C:\Mercurial. Something like setting your username is probably best done only for you, in your %USERPROFILE%\Mercurial.ini. Saving a password for a repository (if done at all) probably goes inside that repos .hg/hgrc file.
As explained by Daniel in the comments, %USERPROFILE% is the expansion of an environment variable. That's necessary because your home directory location differs depending on what version of windows you have, how your administrator configured it, and your name.
AFAIK, the files are not created by default. For storing the login IDs, it's usually a good idea to do what you did, especially if you have a different username for each project you work on.
Otherwise, you could create a Mercurial.ini file under C:\Documents and Settings\<user name>\ (as you are using Windows XP) or under C:\Users\<user name> (if you're using Windows Vista or Windows 7)