File: test_compatible.phpt

package info (click to toggle)
php-pear 1%3A1.10.16%2Bsubmodules%2Bnotgz-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 18,576 kB
  • sloc: php: 52,994; ansic: 39,986; xml: 33,278; yacc: 677; pascal: 452; makefile: 122; sh: 114
file content (36 lines) | stat: -rw-r--r-- 2,131 bytes parent folder | download | duplicates (5)
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
--TEST--
PEAR_PackageFile_Parser_v2_Validator->validate(), compatible tag tests
--SKIPIF--
<?php
if (!getenv('PHP_PEAR_RUNTESTS')) {
    echo 'skip';
}
?>
--FILE--
<?php
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'setup.php.inc';
$pathtopackagexml = dirname(__FILE__)  . DIRECTORY_SEPARATOR .
    'test_compatible'. DIRECTORY_SEPARATOR . 'package.xml';
$pf = $parser->parse(implode('', file($pathtopackagexml)), $pathtopackagexml);
$phpunit->assertIsa('PEAR_PackageFile_v2', $pf, 'ret');
$pf->validate();
$phpunit->assertErrors(array(
    array('package' => 'PEAR_PackageFile_v2', 'message' => 'Invalid tag order in <compatible>, found <> expected one of "name"'),
    array('package' => 'PEAR_PackageFile_v2', 'message' => 'Invalid tag order in <compatible><name>foo1</name>, found <> expected one of "channel"'),
    array('package' => 'PEAR_PackageFile_v2', 'message' => 'Invalid tag order in <compatible><name>foo2</name>, found <> expected one of "min"'),
    array('package' => 'PEAR_PackageFile_v2', 'message' => 'Invalid tag order in <compatible><name>foo3</name>, found <> expected one of "max"'),
    array('package' => 'PEAR_PackageFile_v2', 'message' => 'Invalid tag order in <compatible><name>foo4</name>, found <moo> expected one of "exclude"'),
    array('package' => 'PEAR_PackageFile_v2', 'message' => 'Invalid tag order in <compatible><name>foo5</name>, found <moo> expected one of "exclude"'),
    array('package' => 'PEAR_PackageFile_v2', 'message' => 'Invalid tag order in <compatible><name>foo6</name>, found <moo> expected one of "exclude"'),
    array('package' => 'PEAR_PackageFile_v2', 'message' => 'Version type <compatible><name>foo8</name><min> is not a valid version (#1.0)'),
    array('package' => 'PEAR_PackageFile_v2', 'message' => 'Version type <compatible><name>foo8</name><max> is not a valid version (4.a0)'),
    array('package' => 'PEAR_PackageFile_v2', 'message' => 'Version type <compatible><name>foo8</name><exclude> is not a valid version (2.0^)'),
), '1');
echo 'tests done';
?>
--CLEAN--
<?php
require_once dirname(__FILE__) . '/teardown.php.inc';
?>
--EXPECT--
tests done