Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

Relative paths for awesome console better DX #63

Open
TomasVotruba opened this issue Apr 22, 2020 · 4 comments
Open

Relative paths for awesome console better DX #63

TomasVotruba opened this issue Apr 22, 2020 · 4 comments
Milestone

Comments

@TomasVotruba
Copy link

TomasVotruba commented Apr 22, 2020

I'm using https://plugins.jetbrains.com/plugin/7677-awesome-console in PHPStorm.
It allows you to click on filepaths in CLI and open them in PHPStorm.

It only works reliably with relative paths to cwd() though and PHPUnit uses absolute by default.

E.g. instead of:

-/var/www/projects/my-project/tests/SomeFile.php
+tests/SomeFile.php

Saying that, 2 features might come handy:

1. Relative paths for data provider value, that is file path

Currently, the filename is truncated - see bett...ns.php:

image

It would be great if the bett...ns.php path would be full and relative.


2. Relative path of test case fail

When any assert fail, the path is now absolute (TagValueNodeReprintTest.php:33):

image

@github-actions
Copy link

Awesome! Thank you for taking the time to create your first issue! Please review the guidelines

@prisis prisis added this to the next milestone Apr 22, 2020
@prisis
Copy link
Contributor

prisis commented Apr 22, 2020

You mean something like this? its clickable inside phpstorm
DeepinBildschirmfoto_Bereich auswählen_20200422174241

@TomasVotruba
Copy link
Author

Yes, the part after "at ..."

@prisis
Copy link
Contributor

prisis commented Apr 24, 2020

I released a alpha version https://packagist.org/packages/testomat/phpunit-printer

Run composer require-dev testomat/phpunit-printer

Create a testomat.xml file in the root folder to change some settings if you want

<?xml version="1.0" encoding="UTF-8"?>
<testomat
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="vendor/testomat/phpunit-common/Schema/testomat.xsd"
>
    <printer type="expanded" show_error_on="end">
        <exclude>
            <directory>vendor/phpunit/phpunit/src</directory>
            <directory>vendor/mockery/mockery</directory>
        </exclude>
    </printer>

    <speedtrap>
        <slow_threshold>500</slow_threshold>
        <report_length>10</report_length>
    </speedtrap>
</testomat>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants