<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/oci8.setup.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'oci8.test.php',
    1 => 'Testing',
    2 => 'Testing',
  ),
  'up' => 
  array (
    0 => 'oci8.setup.php',
    1 => 'Installation/Konfiguration',
  ),
  'prev' => 
  array (
    0 => 'oci8.installation.php',
    1 => 'Installation',
  ),
  'next' => 
  array (
    0 => 'oci8.configuration.php',
    1 => 'Laufzeit-Konfiguration',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/oci8/testing.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="oci8.test" class="section">
 <h2 class="title">Testing</h2>
 <p class="para">
  The OCI8 test suite is in <var class="filename">ext/oci8/tests</var>.
  After OCI8 tests are run this directory will also contain logs of
  any failures.
 </p>
 <p class="para">
  Before running PHP&#039;s tests, edit <var class="filename">details.inc</var>
  and set $user, $password and the $dbase connection string.  The
  OCI8 test suite has been developed using
  the <code class="literal">SYSTEM</code> account.  Some tests will fail if
  the test user does not have equivalent permissions.
 </p>
 <p class="para">
  If Oracle Database Resident Connection Pooling is being
  tested, set $test_drcp to <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> and ensure the
  connection string uses an appropriate DRCP pooled server.
 </p>
 <p class="para">
  An alternative to editing <var class="filename">details.inc</var> is the
  set environment variables, for example:
  <div class="example-contents">
<div class="cdata"><pre>
    $ export PHP_OCI8_TEST_USER=system
    $ export PHP_OCI8_TEST_PASS=oracle
    $ export PHP_OCI8_TEST_DB=localhost/XE
    $ export PHP_OCI8_TEST_DRCP=FALSE
</pre></div>
  </div>

  Note in some shells these variables are not propagated correctly
  to the PHP process and tests will fail to connect if this method
  is used.
 </p>
 <p class="para">
  Next, set any necessary environment for the Oracle database.  If you are
  running PHP on the same machines as Oracle Database, you can run:
  <div class="example-contents">
<div class="cdata"><pre>
    $ . /usr/local/bin/oraenv
</pre></div>
  </div>

 </p>
 <p class="para">
  With Oracle 11<em>g</em>R2 XE do:
  <div class="example-contents">
<div class="cdata"><pre>
    $ . /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh
</pre></div>
  </div>

 </p>
 <p class="para">
  Some shells require that <var class="filename">php.ini</var> has <code class="literal">E</code> in the
  variables_order parameter, for example:
  <div class="example-contents">
<div class="cdata"><pre>
    variables_order = &quot;EGPCS&quot;
</pre></div>
  </div>

 </p>
 <p class="para">
  Run all the PHP tests with:
  <div class="example-contents">
<div class="cdata"><pre>
    $ cd your_php_src_directory
    $ make test
</pre></div>
  </div>

  or run only the OCI8 tests with
  <div class="example-contents">
<div class="cdata"><pre>
    $ cd your_php_src_directory
    $ make test TESTS=ext/oci8
</pre></div>
  </div>

 </p>
 <p class="para">
  When the tests have completed, review any test failures. On slow
  systems, some tests may take longer than the default test
  timeout in <var class="filename">run-tests.php</var>.  To correct this,
  set the environment variable <code class="literal">TEST_TIMEOUT</code> to
  a larger number of seconds.
 </p>
 <p class="para">
  On fast machines with a local database configured for light load
  (e.g. Oracle 11<em>g</em>R2 XE) some tests might fail with ORA-12516 or
  ORA-12520 errors.  To prevent this, increase the database
  <code class="literal">PROCESSES</code> parameter using the following steps:
 </p>
 <p class="para">
  Connect as the oracle software owner:
  <div class="example-contents">
<div class="cdata"><pre>
    $ su - oracle
</pre></div>
  </div>

 </p>
 <p class="para">
  Set the necessary Oracle environment with <var class="filename">oracle_env.sh</var> or
  <var class="filename">oraenv</var>, as described above.
 </p>
 <p class="para">
  Start the SQL*Plus command line tool and
  increase <code class="literal">PROCESSES</code>
  <div class="example-contents">
<div class="cdata"><pre>
    $ sqlplus / as sysdba
    SQL&gt; alter system set processes=100 scope=spfile
</pre></div>
  </div>

 </p>
 <p class="para">
  Restart the database:
  <div class="example-contents">
<div class="cdata"><pre>
    SQL&gt; startup force
</pre></div>
  </div>

 </p>
</div><?php manual_footer($setup); ?>