Skip to content
Browse files

fix for phpdoc alpha 2

  • Loading branch information...
1 parent 4a1effe commit 82c22550fde584c86fc992b9c1a5c157c393649c @mepeisen mepeisen committed
View
9 ...0-SNAPSHOT/maven-php-phpdoc/src/main/java/org/phpmaven/phpdoc/impl/PhpdocPearSupport.java
@@ -119,7 +119,14 @@ public void generateReport(Log log, IPhpdocRequest request) throws PhpException
writeXml(log, request, phpDocConfigFile, generatedPhpDocConfigFile);
// there is a very strange dependency mismatching in phpdoc.
// an unknown version 0.17.0 is used as dependency for various things.
- util.installFromMavenRepository("org.phpdoc", "phpDocumentor", "0.17.0");
+ // however it does not really work; maybe we need an empty dummy package.
+
+ //if (>=2.0.0-alpha-2.....) util.installFromMavenRepository("org.phpdoc", "phpDocumentor", "0.17.0");
+ // another option would be to install alpha 1 and after that install alpha 2
+ if (!"2.0.0-alpha-1".equals(this.phpdocVersion)) {
+ util.installFromMavenRepository("org.phpdoc", "phpDocumentor", "2.0.0-alpha-1");
+ }
+
util.installFromMavenRepository("org.phpdoc", "phpDocumentor", this.phpdocVersion);
}
View
29 ...es/2.0-SNAPSHOT/maven-php-plugin-test/src/test/java/org/phpmaven/mojos/test/SiteTest.java
@@ -124,5 +124,34 @@ public void testSitePhpdoc2Alpha() throws Exception {
verifier.assertFilePresent("target/site/apidocs/phpdocumentor/packages.html");
verifier.assertFilePresent("target/site/apidocs/phpdocumentor/default/_MyClass.php.html");
}
+
+ /**
+ * tests the goal "site" with a project containing all default reports.
+ *
+ * @throws Exception
+ */
+ public void testSitePhpdoc2Alpha2() throws Exception {
+ final Verifier verifier = this.getPhpMavenVerifier("mojos-sites/site-phpdoc2-alpha2");
+
+ // delete the pom from previous runs
+ verifier.deleteArtifact("org.phpmaven.test", "site-all", "0.0.1", "pom");
+ verifier.deleteArtifact("org.phpmaven.test", "site-all", "0.0.1", "phar");
+ verifier.setAutoclean(true);
+
+ final List<String> goals = new ArrayList<String>();
+ goals.add("compile");
+ goals.add("test-compile");
+ goals.add("site");
+ verifier.addCliOption("-X");
+ verifier.executeGoals(goals);
+ verifier.verifyErrorFreeLog();
+ verifier.resetStreams();
+
+ // phpdocumentor report
+ verifier.assertFilePresent("target/site/apidocs/phpdocumentor.html");
+ verifier.assertFilePresent("target/site/apidocs/phpdocumentor/index.html");
+ verifier.assertFilePresent("target/site/apidocs/phpdocumentor/packages.html");
+ verifier.assertFilePresent("target/site/apidocs/phpdocumentor/default/_MyClass.php.html");
+ }
}
View
2 ...test/src/test/resources/org/phpmaven/test/projects/mojos-sites/site-phpdoc2-alpha/pom.xml
@@ -22,7 +22,7 @@
<version>2.0-SNAPSHOT</version>
<configuration>
<phpdocService>PEAR</phpdocService>
- <phpdocVersion>2.0.0-alpha-2</phpdocVersion>
+ <phpdocVersion>2.0.0-alpha-1</phpdocVersion>
</configuration>
</plugin>
View
67 ...est/src/test/resources/org/phpmaven/test/projects/mojos-sites/site-phpdoc2-alpha2/pom.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.phpmaven.test</groupId>
+ <artifactId>site-all</artifactId>
+ <packaging>php</packaging>
+ <name>Sample PHP 5 library project</name>
+ <version>0.0.1</version>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.phpmaven</groupId>
+ <artifactId>maven-php-plugin</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <extensions>true</extensions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.phpmaven</groupId>
+ <artifactId>maven-php-phpdoc</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <configuration>
+ <phpdocService>PEAR</phpdocService>
+ <phpdocVersion>2.0.0-alpha-2</phpdocVersion>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>3.0</version>
+ <inherited>true</inherited>
+ <configuration>
+ <reportPlugins>
+ <plugin>
+ <groupId>org.phpmaven</groupId>
+ <artifactId>maven-php-plugin</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>phpdocumentor</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+ </reportPlugins>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>de.phpunit</groupId>
+ <artifactId>PHPUnit</artifactId>
+ <version>3.6.10</version>
+ <scope>test</scope>
+ <type>phar</type>
+ </dependency>
+ </dependencies>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+</project>
View
21 ...urces/org/phpmaven/test/projects/mojos-sites/site-phpdoc2-alpha2/src/main/php/MyClass.php
@@ -0,0 +1,21 @@
+<?php
+
+/**
+ * A simple test class.
+ *
+ * @author Martin Eisengardt
+ */
+class MyMavenTestClass
+{
+
+ /**
+ * Get the string "foo".
+ *
+ * @return string A string "foo"
+ */
+ public static function getFoo()
+ {
+ return "foo";
+ }
+
+}
View
20 ...urces/org/phpmaven/test/projects/mojos-sites/site-phpdoc2-alpha2/src/test/php/FooTest.php
@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * The foo test class
+ *
+ * @author mepeisen
+ */
+class FooTest extends PHPUnit_Framework_TestCase
+{
+
+ /**
+ * tests the bar function
+ */
+ public function testFoo()
+ {
+ include "MyClass.php";
+ $this->assertEquals("foo", MyMavenTestClass::getFoo());
+ }
+
+}

0 comments on commit 82c2255

Please sign in to comment.
Something went wrong with that request. Please try again.