diff options
| author | Sean Finney <seanius@debian.org> | 2009-06-24 22:49:04 +0200 |
|---|---|---|
| committer | Sean Finney <seanius@debian.org> | 2009-06-24 22:49:04 +0200 |
| commit | 84f4ca9b07fe5b73d840258f4aa7c1eb534c4253 (patch) | |
| tree | 9829bd578af8a4a8b42b04277f9067e00dc5ad90 /scripts/dev/generate-phpt/tests/gtFunctionTest.php | |
| parent | 6821b67124604da690c5e9276d5370d679c63ac8 (diff) | |
| download | php-84f4ca9b07fe5b73d840258f4aa7c1eb534c4253.tar.gz | |
Imported Upstream version 5.3.0~RC4upstream/5.3.0_RC4upstream/5.3.0.RC4
Diffstat (limited to 'scripts/dev/generate-phpt/tests/gtFunctionTest.php')
| -rw-r--r-- | scripts/dev/generate-phpt/tests/gtFunctionTest.php | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/scripts/dev/generate-phpt/tests/gtFunctionTest.php b/scripts/dev/generate-phpt/tests/gtFunctionTest.php new file mode 100644 index 000000000..0aa7eac11 --- /dev/null +++ b/scripts/dev/generate-phpt/tests/gtFunctionTest.php @@ -0,0 +1,71 @@ +cd +<?php +require_once 'PHPUnit/Framework.php'; +require_once dirname(__FILE__) . '/../src/gtAutoload.php'; + + +class gtFunctionTest extends PHPUnit_Framework_TestCase +{ + public function testArguments() { + + $f = new gtFunction('cos'); + $f->setArgumentNames(); + $m = $f->getMandatoryArgumentNames(); + $this->assertEquals($m[0], 'number'); + } + + public function testArguments2() { + + $f = new gtFunction('version_compare'); + $f->setArgumentNames(); + $m = $f->getMandatoryArgumentNames(); + $o = $f->getOptionalArgumentNames(); + $this->assertEquals($m[0], 'ver1'); + $this->assertEquals($m[1], 'ver2'); + $this->assertEquals($o[0], 'oper'); + + } + + public function testExtraArguments() { + + $f = new gtFunction('version_compare'); + $f->setArgumentNames(); + $f->setExtraArgumentList(); + + $this->assertEquals('$ver1, $ver2, $oper, $extra_arg', $f->getExtraArgumentList()); + } + + public function testShortArguments() { + + $f = new gtFunction('version_compare'); + $f->setArgumentNames(); + $f->setShortArgumentList(); + + $this->assertEquals('$ver1', $f->getShortArgumentList()); + } + + public function testAllArgumentList() { + + $f = new gtFunction('version_compare'); + $f->setArgumentNames(); + $f->setValidArgumentLists(); + $a = $f->getValidArgumentLists(); + + $this->assertEquals('$ver1, $ver2', $a[0]); + $this->assertEquals('$ver1, $ver2, $oper', $a[1]); + } + + public function testInitialisation() { + + $f = new gtFunction('version_compare'); + $f->setArgumentNames(); + $f->setInitialisationStatements(); + $a = $f->getInitialisationStatements(); + + $this->assertEquals('$ver1 = ', $a[0]); + $this->assertEquals('$ver2 = ', $a[1]); + $this->assertEquals('$oper = ', $a[2]); + } + +} +?>
\ No newline at end of file |
