Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions Zend/tests/closures/closure_from_callable.inc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Foo
{
return $param1;
}

private static function privateStaticFunction($param1)
{
return $param1;
Expand All @@ -41,18 +41,18 @@ class Foo
{
return $param1;
}

protected function protectedInstanceFunc($param1)
{
return $param1;
}


public function publicInstanceFunc($param1)
{
return $param1;
}

public function closePrivateValid()
{
return Closure::fromCallable([$this, 'privateInstanceFunc']);
Expand Down Expand Up @@ -87,23 +87,23 @@ class Foo


class SubFoo extends Foo {

public function closePrivateStaticInvalid()
{
return Closure::fromCallable([__CLASS__, 'privateStaticFunction']);
}


public function closePrivateInvalid()
{
return Closure::fromCallable([$this, 'privateInstanceFunc']);
}

public function closeProtectedStaticMethod()
{
return Closure::fromCallable([__CLASS__, 'protectedStaticFunction']);
}

public function closeProtectedValid()
{
return Closure::fromCallable([$this, 'protectedInstanceFunc']);
Expand All @@ -113,13 +113,13 @@ class SubFoo extends Foo {
{
return Closure::fromCallable('parent::publicInstanceFunc');
}

public function getSelfColonParentPublicInstanceMethod()
{
return Closure::fromCallable('self::publicInstanceFunc');
}


public function getSelfColonParentProtectedInstanceMethod()
{
return Closure::fromCallable('self::protectedInstanceFunc');
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/list_keyed_evaluation_order.inc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class IndexableRetrievable
{
private $label;
private $indexable;

public function __construct(string $label, Indexable $indexable) {
$this->label = $label;
$this->indexable = $indexable;
Expand Down
6 changes: 3 additions & 3 deletions ext/calendar/tests/skipif.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
if(!extension_loaded("calendar"))
print "skip - CALENDAR extension not available";
<?php
if(!extension_loaded("calendar"))
print "skip - CALENDAR extension not available";
?>
4 changes: 2 additions & 2 deletions ext/curl/tests/server.inc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function curl_cli_server_start() {
if(getenv('PHP_CURL_HTTP_REMOTE_SERVER')) {
return getenv('PHP_CURL_HTTP_REMOTE_SERVER');
}

$php_executable = getenv('TEST_PHP_EXECUTABLE');
$doc_root = __DIR__;
$router = "responder/get.php";
Expand All @@ -30,7 +30,7 @@ function curl_cli_server_start() {

$handle = proc_open($cmd, $descriptorspec, $pipes, $doc_root);
}

// note: even when server prints 'Listening on localhost:8964...Press Ctrl-C to quit.'
// it might not be listening yet...need to wait until fsockopen() call returns
$error = "Unable to connect to server\n";
Expand Down
16 changes: 8 additions & 8 deletions ext/gd/tests/func.inc
Original file line number Diff line number Diff line change
Expand Up @@ -18,44 +18,44 @@ function get_php_info()
function get_freetype_version()
{
$version = 0;

if (preg_match(',FreeType Version => (\d+\.\d+\.\d+),s', get_php_info(), $match)) {
$version = $match[1];
}

return $version;
}

function get_libjpeg_version()
{
$version = 0;

if (preg_match(',libJPEG Version => ([a-z0-9]+),s', get_php_info(), $match)) {
$version = $match[1];
}

return $version;
}

function get_libpng_version()
{
$version = 0;

if (preg_match(',libPNG Version => (\d+\.\d+\.\d+),s', get_php_info(), $match)) {
$version = $match[1];
}

return $version;
}

function get_libxpm_version()
{
$version = 0;

if (preg_match(',libXpm Version => (\d+),s', get_php_info(), $match)) {
$version = $match[1];
}

return $version;
}

Expand Down
8 changes: 4 additions & 4 deletions ext/imap/tests/clean.inc
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ $imap_stream = imap_open($default_mailbox, $username, $password);
// delete all msgs in default mailbox, i.e INBOX
$check = imap_check($imap_stream);
for ($i = 1; $i <= $check->Nmsgs; $i++) {
imap_delete($imap_stream, $i);
imap_delete($imap_stream, $i);
}

$mailboxes = imap_getmailboxes($imap_stream, $server, '*');

foreach($mailboxes as $value) {
// Only delete mailboxes with our prefix
if (preg_match('/\{.*?\}INBOX\.(.+)/', $value->name, $match) == 1) {
if (strlen($match[1]) >= strlen($mailbox_prefix)
if (strlen($match[1]) >= strlen($mailbox_prefix)
&& substr_compare($match[1], $mailbox_prefix, 0, strlen($mailbox_prefix)) == 0) {
imap_deletemailbox($imap_stream, $value->name);
}
}
}
}

imap_close($imap_stream, CL_EXPUNGE);
imap_close($imap_stream, CL_EXPUNGE);
?>
52 changes: 26 additions & 26 deletions ext/imap/tests/imap_include.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
$server = '{127.0.0.1/norsh}';
$default_mailbox = $server . "INBOX";
$domain = "something.com";
$admin_user = "webmaster"; // a user with admin access
$admin_user = "webmaster"; // a user with admin access
$username = "$admin_user@$domain";
$password = 'p4ssw0rd';
$users = array("webmaster", "info", "admin", "foo"); // tests require 4 valid userids
Expand Down Expand Up @@ -56,39 +56,39 @@ function displayOverviewFields($resp, $fields=null) {


/**
* Create a test mailbox and populate with msgs
* Create a test mailbox and populate with msgs
*
* @param string mailbox_suffix Suffix used to uniquely identify mailboxes
* @param int message_count number of test msgs to be written to new mailbox
*
* @param int message_count number of test msgs to be written to new mailbox
*
* @return IMAP stream to new mailbox on success; FALSE on failure
*/
function setup_test_mailbox($mailbox_suffix, $message_count, &$new_mailbox = null, $msg_type = "simple"){
global $server, $default_mailbox, $username, $password;

// open a stream to default mailbox
$imap_stream = imap_open($default_mailbox, $username, $password);

if ($imap_stream === false) {
echo "Cannot connect to IMAP server $server: " . imap_last_error() . "\n";
return false;
}
}

echo "Create a temporary mailbox and add " . $message_count . " msgs\n";
$new_mailbox = create_mailbox($imap_stream, $mailbox_suffix, $message_count, $msg_type);
if ($new_mailbox === false) {
echo "Cant create a temporary mailbox: " . imap_last_error(). "\n";
return false;
}

echo ".. mailbox '$new_mailbox' created\n";

// reopen stream to new mailbox
if (imap_reopen($imap_stream, $new_mailbox) === false) {
echo "cant re-open '$new_mailbox' mailbox: " . imap_last_error() . "\n";
return false;
}

return $imap_stream;
}

Expand All @@ -101,27 +101,27 @@ function setup_test_mailbox($mailbox_suffix, $message_count, &$new_mailbox = nul
function create_mailbox($imap_stream, $mailbox_suffix, $message_count, $msg_type= "simple"){
global $default_mailbox, $mailbox_prefix;
$mailbox = $default_mailbox . "." . $mailbox_prefix . $mailbox_suffix;

$mailboxes = imap_getmailboxes($imap_stream, $mailbox, '*');

// check mailbox does not already exist
if ($mailboxes) {
foreach($mailboxes as $value) {
if ($value->name == $mailbox) {
exit ("TEST FAILED : Mailbox '$mailbox' already exists\n");
}
}
}
}

if (imap_createmailbox($imap_stream, $mailbox) === false) {
return false;
}

// Add number of test msgs requested
if ($message_count > 0) {
populate_mailbox($imap_stream, $mailbox, $message_count, $msg_type);
}
}

return $mailbox;
}

Expand All @@ -146,42 +146,42 @@ function populate_mailbox($imap_stream, $mailbox, $message_count, $msg_type = "s
$envelope["from"]= "foo@anywhere.com";
$envelope["to"] = "$users[0]@$domain";
$envelope["subject"] = "Test msg $i";

$part1["type"] = TYPEMULTIPART;
$part1["subtype"] = "mixed";

$part2["type"] = TYPETEXT;
$part2["subtype"] = "plain";
$part2["description"] = "imap_mail_compose() function";
$part2["contents.data"] = "message 1:xxxxxxxxxxxxxxxxxxxxxxxxxx";

$part3["type"] = TYPETEXT;
$part3["subtype"] = "plain";
$part3["description"] = "Example";
$part3["contents.data"] = "message 2:yyyyyyyyyyyyyyyyyyyyyyyyyy";

$part4["type"] = TYPETEXT;
$part4["subtype"] = "plain";
$part4["description"] = "Return Values";
$part4["contents.data"] = "message 3:zzzzzzzzzzzzzzzzzzzzzzzzzz";

$body[1] = $part1;
$body[2] = $part2;
$body[3] = $part3;
$body[4] = $part4;

$msg = imap_mail_compose($envelope, $body);
}

imap_append($imap_stream, $mailbox, $msg);
}
}

/**
* Get the mailbox name from a mailbox decription, i.e strip off server details.
* Get the mailbox name from a mailbox decription, i.e strip off server details.
*
* @param string mailbox complete mailbox name
* @return mailbox name
* @param string mailbox complete mailbox name
* @return mailbox name
*/
function get_mailbox_name($mailbox){

Expand Down
2 changes: 1 addition & 1 deletion ext/imap/tests/skipif.inc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
extension_loaded('imap') or die('skip imap extension not available in this build');

// Change these to make tests run successfully
$mailbox = '{localhost/norsh}';
$username = 'webmaster@something.com';
Expand Down
4 changes: 2 additions & 2 deletions ext/interbase/tests/interbase.inc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function init_db()
{
global $test_base, $user, $password;

$test_db = ibase_query(IBASE_CREATE,
$test_db = ibase_query(IBASE_CREATE,
sprintf("CREATE SCHEMA '%s' USER '%s' PASSWORD '%s' DEFAULT CHARACTER SET %s",$test_base,
$user, $password, ($charset = ini_get('ibase.default_charset')) ? $charset : 'NONE'));
$tr = ibase_trans($test_db);
Expand All @@ -28,7 +28,7 @@ function init_db()
function cleanup_db()
{
global $test_base;

$r = ibase_connect($test_base);
ibase_drop_db($r);
}
Expand Down
2 changes: 1 addition & 1 deletion ext/interbase/tests/skipif.inc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

if (!extension_loaded("interbase")) print "skip interbase extension not available";
if (!extension_loaded("interbase")) print "skip interbase extension not available";
require("interbase.inc");
if(!@ibase_connect($test_base)){
die("skip cannot connnect");
Expand Down
6 changes: 3 additions & 3 deletions ext/mbstring/tests/common.inc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Custom Error Hanlder for testing
function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
global $debug;

$err_type = array (
1 => "Error", // E_ERROR
2 => "Warning", // E_WARINING
Expand All @@ -23,7 +23,7 @@ function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
4096=> "Recoverable fatal error", // E_RECOVERABLE_ERROR
8192=> "Deprecated", // E_DEPRECATED
);

if (!empty($debug)) {
printf("%s: %s (%d)\n", $err_type[$err_no], $err_msg, $linenum);
}
Expand All @@ -46,7 +46,7 @@ class tc
public $s1 = '���ܸ�EUC-JP��ʸ����';
public $s2 = 'English Text';

function __construct()
function __construct()
{
}
}
Expand Down
Loading