From bbe4b75381e1330189ddeec5ae6e4057e650808c Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 26 Jan 2018 11:45:24 +0100 Subject: reorg tests --- tests/001-presence.phpt | 10 ++ tests/001.phpt | 10 -- tests/002-rpmvercmp.phpt | 29 +++++ tests/002.phpt | 29 ----- tests/003-rpminfo.phpt | 30 ++++++ tests/003.phpt | 270 ----------------------------------------------- tests/004-constants.phpt | 12 +++ 7 files changed, 81 insertions(+), 309 deletions(-) create mode 100644 tests/001-presence.phpt delete mode 100644 tests/001.phpt create mode 100644 tests/002-rpmvercmp.phpt delete mode 100644 tests/002.phpt create mode 100644 tests/003-rpminfo.phpt delete mode 100644 tests/003.phpt create mode 100644 tests/004-constants.phpt (limited to 'tests') diff --git a/tests/001-presence.phpt b/tests/001-presence.phpt new file mode 100644 index 0000000..69f6aff --- /dev/null +++ b/tests/001-presence.phpt @@ -0,0 +1,10 @@ +--TEST-- +Check for rpminfo presence +--SKIPIF-- + +--FILE-- + +--EXPECT-- +rpminfo extension is available diff --git a/tests/001.phpt b/tests/001.phpt deleted file mode 100644 index 69f6aff..0000000 --- a/tests/001.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Check for rpminfo presence ---SKIPIF-- - ---FILE-- - ---EXPECT-- -rpminfo extension is available diff --git a/tests/002-rpmvercmp.phpt b/tests/002-rpmvercmp.phpt new file mode 100644 index 0000000..6cffef0 --- /dev/null +++ b/tests/002-rpmvercmp.phpt @@ -0,0 +1,29 @@ +--TEST-- +Check for rpmvercmp function +--SKIPIF-- + +--FILE-- + +Done +--EXPECTF-- +int(-1) +int(1) +int(0) + +Warning: rpmvercmp() expects exactly 2 parameters, 0 given in %s/002-rpmvercmp.php on line 6 +NULL + +Warning: rpmvercmp() expects exactly 2 parameters, 1 given in %s/002-rpmvercmp.php on line 7 +NULL + +Warning: rpmvercmp() expects exactly 2 parameters, 3 given in %s/002-rpmvercmp.php on line 8 +NULL +Done diff --git a/tests/002.phpt b/tests/002.phpt deleted file mode 100644 index 27c3a84..0000000 --- a/tests/002.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Check for rpmvercmp function ---SKIPIF-- - ---FILE-- - -Done ---EXPECTF-- -int(-1) -int(1) -int(0) - -Warning: rpmvercmp() expects exactly 2 parameters, 0 given in %s/002.php on line 6 -NULL - -Warning: rpmvercmp() expects exactly 2 parameters, 1 given in %s/002.php on line 7 -NULL - -Warning: rpmvercmp() expects exactly 2 parameters, 3 given in %s/002.php on line 8 -NULL -Done diff --git a/tests/003-rpminfo.phpt b/tests/003-rpminfo.phpt new file mode 100644 index 0000000..f7cee82 --- /dev/null +++ b/tests/003-rpminfo.phpt @@ -0,0 +1,30 @@ +--TEST-- +Check for rpminfo function +--SKIPIF-- + +--FILE-- + +Done +--EXPECTF-- +array(4) { + ["Name"]=> + string(5) "bidon" + ["Version"]=> + string(1) "1" + ["Release"]=> + string(11) "1.fc25.remi" + ["Arch"]=> + string(6) "x86_64" +} + +Warning: rpminfo(): Can't open '%s/tests/missing.rpm': No such file or directory in %s/003-rpminfo.php on line %d +bool(false) + +Warning: rpminfo(): Can't read '%s/tests/003-rpminfo.php': Argument is not a RPM file in %s/003-rpminfo.php on line %d +bool(false) +Done diff --git a/tests/003.phpt b/tests/003.phpt deleted file mode 100644 index 5a46dac..0000000 --- a/tests/003.phpt +++ /dev/null @@ -1,270 +0,0 @@ ---TEST-- -Check for rpminfo function ---SKIPIF-- - ---FILE-- - -Done ---EXPECTF-- -array(4) { - ["Name"]=> - string(5) "bidon" - ["Version"]=> - string(1) "1" - ["Release"]=> - string(11) "1.fc25.remi" - ["Arch"]=> - string(6) "x86_64" -} -array(63) { - ["Headeri18ntable"]=> - string(1) "C" - ["Sigsize"]=> - int(2304) - ["Sigmd5"]=> - string(32) "644819c3566819b1e10a5c97943de094" - ["Sha1header"]=> - string(40) "0a86742fe53973ac9ab4611187a83ffb44f1de5a" - ["Sha256header"]=> - string(64) "9aab7242a80212ad1fe4fdd3b250c0c4f176c0b3fb1355c0d62ff094fc3f7da0" - ["Name"]=> - string(5) "bidon" - ["Version"]=> - string(1) "1" - ["Release"]=> - string(11) "1.fc25.remi" - ["Summary"]=> - string(5) "Bidon" - ["Description"]=> - string(15) "A dummy package" - ["Buildtime"]=> - int(1516882146) - ["Buildhost"]=> - string(20) "builder.remirepo.net" - ["Size"]=> - int(29) - ["Vendor"]=> - string(11) "Remi Collet" - ["License"]=> - string(13) "Public Domain" - ["Packager"]=> - string(36) "Remi Collet " - ["Group"]=> - string(11) "Unspecified" - ["Url"]=> - string(30) "http://blog.famillecollet.com/" - ["Os"]=> - string(5) "linux" - ["Arch"]=> - string(6) "x86_64" - ["Filesizes"]=> - int(0) - ["Filemodes"]=> - int(0) - ["Filerdevs"]=> - int(0) - ["Filemtimes"]=> - int(0) - ["Filedigests"]=> - NULL - ["Filelinktos"]=> - NULL - ["Fileflags"]=> - int(0) - ["Fileusername"]=> - NULL - ["Filegroupname"]=> - NULL - ["Sourcerpm"]=> - string(27) "bidon-1-1.fc25.remi.src.rpm" - ["Fileverifyflags"]=> - int(0) - ["Archivesize"]=> - int(428) - ["Providename"]=> - NULL - ["Requireflags"]=> - int(0) - ["Requirename"]=> - NULL - ["Requireversion"]=> - NULL - ["Rpmversion"]=> - string(6) "4.14.0" - ["Changelogtime"]=> - int(1419422400) - ["Changelogname"]=> - string(42) "Remi Collet - 1-1" - ["Changelogtext"]=> - string(8) "- create" - ["Cookie"]=> - string(31) "builder.remirepo.net 1516882146" - ["Filedevices"]=> - int(0) - ["Fileinodes"]=> - int(0) - ["Filelangs"]=> - NULL - ["Provideflags"]=> - int(0) - ["Provideversion"]=> - NULL - ["Dirindexes"]=> - int(0) - ["Basenames"]=> - NULL - ["Dirnames"]=> - NULL - ["Optflags"]=> - string(219) "-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic" - ["Payloadformat"]=> - string(4) "cpio" - ["Payloadcompressor"]=> - string(2) "xz" - ["Payloadflags"]=> - string(1) "2" - ["Platform"]=> - string(23) "x86_64-redhat-linux-gnu" - ["Filecolors"]=> - int(0) - ["Fileclass"]=> - int(0) - ["Classdict"]=> - NULL - ["Sourcepkgid"]=> - string(32) "188da2a3966f4a5f0dd48e784be76846" - ["Filedigestalgo"]=> - int(8) - ["Encoding"]=> - string(5) "utf-8" - ["Payloaddigest"]=> - string(64) "ace77d50077cb8088d9bf224c9a9e89343a2aa40fe596b3e60ef10a9a200a3bd" - ["Payloaddigestalgo"]=> - int(8) - ["IsSource"]=> - bool(false) -} -array(54) { - ["Headeri18ntable"]=> - string(1) "C" - ["Sigsize"]=> - int(1753) - ["Sigmd5"]=> - string(32) "188da2a3966f4a5f0dd48e784be76846" - ["Sha1header"]=> - string(40) "994275fb4366d82043c791c50682cbe46e1c96d6" - ["Sha256header"]=> - string(64) "4c2f1cba929cc05ce58d4a9184d4652f2f7d7bdf05ba1dc92966ce9e9cefe93c" - ["Name"]=> - string(5) "bidon" - ["Version"]=> - string(1) "1" - ["Release"]=> - string(11) "1.fc25.remi" - ["Summary"]=> - string(5) "Bidon" - ["Description"]=> - string(15) "A dummy package" - ["Buildtime"]=> - int(1516882146) - ["Buildhost"]=> - string(20) "builder.remirepo.net" - ["Size"]=> - int(360) - ["Vendor"]=> - string(11) "Remi Collet" - ["License"]=> - string(13) "Public Domain" - ["Packager"]=> - string(36) "Remi Collet " - ["Group"]=> - string(11) "Unspecified" - ["Url"]=> - string(30) "http://blog.famillecollet.com/" - ["Os"]=> - string(5) "linux" - ["Arch"]=> - string(6) "x86_64" - ["Filesizes"]=> - int(360) - ["Filemodes"]=> - int(33188) - ["Filerdevs"]=> - int(0) - ["Filemtimes"]=> - int(1516882140) - ["Filedigests"]=> - string(64) "195d7dd3ca9518024a1554e68b3f63fa7e2bdaa4efac59f06c1ab231283e6067" - ["Filelinktos"]=> - string(0) "" - ["Fileflags"]=> - int(32) - ["Fileusername"]=> - string(6) "extras" - ["Filegroupname"]=> - string(4) "remi" - ["Fileverifyflags"]=> - int(4294967295) - ["Archivesize"]=> - int(608) - ["Requireflags"]=> - int(0) - ["Requirename"]=> - NULL - ["Requireversion"]=> - NULL - ["Rpmversion"]=> - string(6) "4.14.0" - ["Changelogtime"]=> - int(1419422400) - ["Changelogname"]=> - string(42) "Remi Collet - 1-1" - ["Changelogtext"]=> - string(8) "- create" - ["Cookie"]=> - string(31) "builder.remirepo.net 1516882146" - ["Filedevices"]=> - int(1) - ["Fileinodes"]=> - int(1) - ["Filelangs"]=> - string(0) "" - ["Sourcepackage"]=> - int(1) - ["Dirindexes"]=> - int(0) - ["Basenames"]=> - string(10) "bidon.spec" - ["Dirnames"]=> - string(0) "" - ["Payloadformat"]=> - string(4) "cpio" - ["Payloadcompressor"]=> - string(4) "gzip" - ["Payloadflags"]=> - string(1) "9" - ["Filedigestalgo"]=> - int(8) - ["Encoding"]=> - string(5) "utf-8" - ["Payloaddigest"]=> - string(64) "b104f6e80a0b761ca05b0c478c5a5e3f5fe57cf079cfca53d360351806c23951" - ["Payloaddigestalgo"]=> - int(8) - ["IsSource"]=> - bool(true) -} - -Warning: rpminfo(): Can't open '%s/tests/missing.rpm': No such file or directory in %s/003.php on line 6 -bool(false) - -Warning: rpminfo(): Can't read '%s/tests/003.php': Argument is not a RPM file in %s/003.php on line 7 -bool(false) -Done diff --git a/tests/004-constants.phpt b/tests/004-constants.phpt new file mode 100644 index 0000000..397c97f --- /dev/null +++ b/tests/004-constants.phpt @@ -0,0 +1,12 @@ +--TEST-- +Check for RPMVERSION constant +--SKIPIF-- + +--FILE-- + +Done +--EXPECTF-- +string(%d) "4.%s" +Done -- cgit