summaryrefslogtreecommitdiffstats
path: root/tests/015-rpmmacro.phpt
blob: 794cabfc0ba7fae63ff93f415169711dbdc555b4 (plain)
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
--TEST--
Check for rpmdefine, rpmexpand, rpmexpandnumeric
--SKIPIF--
<?php if (!extension_loaded("rpminfo")) print "skip"; ?>
--FILE--
<?php 
var_dump(is_dir(rpmexpand("%{_dbpath}")));

var_dump(rpmexpandnumeric("%__isa_bits") === PHP_INT_SIZE * 8);
var_dump(is_int(rpmexpandnumeric("0%{?fedora}%{?rhel}")));

$name = "_my_test_macro_for_rpminfo_";
$val  = __FILE__;
var_dump(rpmexpand("%$name") === "%$name" );
var_dump(rpmdefine("$name $val"));
var_dump(rpmexpand("%$name") === __FILE__);
?>
--EXPECT--
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)