com web/qa: Document --CONFLICTS-- section: phpt_details.ph p sample_tests/conflicts_1.php

From: Date: Mon, 13 May 2019 11:05:32 +0000
Subject: com web/qa: Document --CONFLICTS-- section: phpt_details.ph p sample_tests/conflicts_1.php
Groups: php.qa 
Request: Send a blank email to php-qa+get-68503@lists.php.net to get a copy of this message
Commit: 1770568a7169bfa94167b77222462f1c161d6b74 Author: Christoph M. Becker <cmbecker69@gmx.de> Mon, 13 May 2019 13:05:32 +0200 Parents: e2a97934562066b18422a5a60daee8faeb923b79 Branches: master Link: http://git.php.net/?p=web/qa.git;a=commitdiff;h=1770568a7169bfa94167b77222462f1c161d6b74 Log: Document --CONFLICTS-- section Cf. <http://git.php.net/?p=php-src.git;a=commit;h=c0e15a3b7fef5b341eb96e0e888f180ba7a39570> Changed paths: M phpt_details.php A sample_tests/conflicts_1.php Diff: diff --git a/phpt_details..php b/phpt_details.php index d4e8b00..f9ac10f 100644 --- a/phpt_details.php +++ b/phpt_details.php @@ -19,6 +19,7 @@ common_header(); [<a href="#description_section">--DESCRIPTION--</a>]<br/> [<a href="#credits_section">--CREDITS--</a>]<br/> [<a href="#skipif_section">--SKIPIF--</a>]<br/> +[<a href="#conflicts_section">--CONFLICTS--</a>]<br/> [<a href="#capture_stdio_section">--CAPTURE_STDIO--</a>]<br/> [<a href="#extensions_section">--EXTENSIONS--</a>]<br/> [<a href="#post_section">--POST--</a> | <a href="#put_section">--PUT--</a> | <a href="#post_raw_section">--POST_RAW--</a> | <a href="#gzip_post_section">--GZIP_POST--</a> | <a href="#deflate_post_section">--DEFLATE_POST--</a> | <a href="#get_section">--GET--</a>]<br/> @@ -123,6 +124,28 @@ PHP code enclosed by PHP tags.</p> <p><b>Example 2 (full):</b> <a href="sample_tests/sample003.php">sample003.phpt</a></p> </dd> +<dt id="conflicts_section">--CONFLICTS--</dt> +<dd> +<p><b>Description:</b><br/> +<p>This section is only relevant for parallel test execution (available as of +PHP 7.4.0), and allows to specify conflict keys. While a test that conflicts +with key K is running, no other test that conflicts with K is run. +For tests conflicting with "all", no other tests are run in parallel.</p> +<p>An alternative to have a --CONFLICTS-- section is to add a file named +CONFLICTS to the directory containing the tests. The contents of the CONFLICTS +file must have the same format as the contents of the --CONFLICTS-- section. +</p> +<p><b>Required:</b><br/> +No.</p> +<p><b>Format:</b><br/> +One conflict key per line. Comment lines starting with # are also allowed.</p> +<p><b>Example 1 (snippet):</b><br/> +<pre>--CONFLICTS-- +server</pre> +</p> +<p><b>Example 1 (full):</b> <a href="sample_tests/conflicts_1.php">conflicts_1.phpt</a></p> +</dd> + <dt id="capture_stdio_section">--CAPTURE_STDIO--</dt> <dd> <p><b>Description:</b><br/> diff --git a/sample_tests/conflicts_1.php b/sample_tests/conflicts_1.php new file mode 100644 index 0000000..c437e0e --- /dev/null +++ b/sample_tests/conflicts_1.php @@ -0,0 +1,49 @@ +<?php +include("../include/functions.php"); + +$TITLE = "Sample Test [PHP-QAT: Quality Assurance Team]"; +$SITE_UPDATE = date("D M d H:i:s Y T", filectime(__FILE__)); + +common_header(); +?> + +<div style="padding: 10px"> +<h1>Sample Test: conflicts_1.phpt</h1> +<p>Back to &quot;<a href="../phpt_details.php">PHPT Test File Layout</a>&quot;</p> +<pre>--TEST-- +Test get_headers() function : test with context +--CONFLICTS-- +server +--FILE-- +&lt;?php + +include __DIR__.&quot;/../../../../sapi/cli/tests/php_cli_server.inc&quot;; +php_cli_server_start(&#039;header(&quot;X-Request-Method: &quot;.$_SERVER[&quot;REQUEST_METHOD&quot;]);&#039;); + +$opts = array( + &#039;http&#039; =&gt; array( + &#039;method&#039; =&gt; &#039;HEAD&#039; + ) +); + +$context = stream_context_create($opts); +$headers = get_headers(&quot;http://&quot;.PHP_CLI_SERVER_ADDRESS, 1, $context); +echo $headers[&quot;X-Request-Method&quot;].&quot;\n&quot;; + +stream_context_set_default($opts); +$headers = get_headers(&quot;http://&quot;.PHP_CLI_SERVER_ADDRESS, 1); +echo $headers[&quot;X-Request-Method&quot;].&quot;\n&quot;; + +echo &quot;Done&quot;; +?&gt; +--EXPECT-- +HEAD +HEAD +Done +</pre> +<p>Back to &quot;<a href="../phpt_details.php">PHPT Test File Layout</a>&quot;</p> +</div> + +<?php +common_footer(); +?>

« previous php.qa (#68503) next »