File: skip.inc

package info (click to toggle)
php-oauth 2.0.2%2B1.2.3-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 816 kB
  • ctags: 950
  • sloc: ansic: 7,197; xml: 841; php: 536; makefile: 1
file content (69 lines) | stat: -rw-r--r-- 1,219 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php

if (!defined('PHP_MAJOR_VERSION')) {
	list($major,$minor,$release) = split('[.-]', PHP_VERSION);
	define('PHP_MAJOR_VERSION', $major);
	define('PHP_MINOR_VERSION', $minor);
	define('PHP_RELEASE_VERSION', $release);
}

function skip_if_not_php_major($version)
{
	if (PHP_MAJOR_VERSION!=$version) {
		die("skip Only for PHP $version");
	}
}

function skip_of_not_at_least_php_major($version)
{
	if (PHP_MAJOR_VERSION<$version) {
		die("skip Only from PHP $version onwards");
	}
}

function skip_if_php_major($version)
{
	if (PHP_MAJOR_VERSION==$version) {
		die("skip Not for PHP $version");
	}
}

function skip_if_not_ext($ext)
{
	if (!extension_loaded($ext)) {
		die("skip $ext not loaded");
	}
}

function skip_if_not_constant($constant)
{
	if (!defined($constant)) {
		die("skip $constant not defined");
	}
}

function has_bug($bugid)
{
	switch ($bugid) {
		case '44603':
			// >= 5.1.0 && < 5.2.6
			return (PHP_MINOR_VERSION==1 || (PHP_MINOR_VERSION==2 && PHP_RELEASE_VERSION<6));
	}
	return false;
}

function skip_without_bug($bugid)
{
	if (!has_bug($bugid)) {
		die('skip Only for bug #'.$bugid);
	}
}

function skip_with_bug($bugid)
{
	if (has_bug($bugid)) {
		die('skip Not for bug #'.$bugid);
	}
}

?>