Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #18465

define constants in the phpunit.xml.dist file

From alex <1j9448a02@lnx159sneakemail.com.invalid>
Newsgroups comp.lang.php
Subject define constants in the phpunit.xml.dist file
Date 2020-12-21 09:54 +0100
Organization Aioe.org NNTP Server
Message-ID <rrpns3$pdv$1@gioia.aioe.org> (permalink)

Show all headers | View raw


+ cd /tmp/test
+ cat composer.json
{
     "require-dev": {
         "phpunit/phpunit": "^9.5"
     }
}
+ cat phpunit.xml.dist
<phpunit bootstrap="bootstrap.php">
     <php>
         <const name="PHPUNIT_BOOL" value="true"/>
         <const name="PHPUNIT_STRING" value="__DIR__"/>
     </php>
</phpunit>
+ cat bootstrap.php
<?php
var_dump(
     PHPUNIT_BOOL,
     PHPUNIT_STRING,
);
+ vendor/bin/phpunit
/tmp/test/bootstrap.php:4:
bool(true)
/tmp/test/bootstrap.php:4:
string(7) "__DIR__"

However I would like that instead of__DIR__, is displayed /tmp/test.

Specifically, it appears that the constant PHPUNIT_STRING is not 
evaluated as I would like.
Instead with the constant PHPUNIT_BOOL the result is OK.

There is a solution?

Back to comp.lang.php | Previous | NextNext in thread | Find similar | Unroll thread


Thread

define constants in the phpunit.xml.dist file alex <1j9448a02@lnx159sneakemail.com.invalid> - 2020-12-21 09:54 +0100
  Re: define constants in the phpunit.xml.dist file Kristjan Robam <he1983912@aol.com> - 2022-08-27 02:16 -0700

csiph-web