Exemple #1
0
 public function testEmptyElementIfIsReference()
 {
     $m = new Mapper($this->project);
     $m->setFrom("*.java");
     try {
         $m->setRefid(new Reference("dummyref"));
         $this->fail("Can add reference to Mapper with from attribute set");
     } catch (BuildException $be) {
         $this->assertEquals("You must not specify more than one attribute when using refid", $be->getMessage());
     }
     $m = new Mapper($this->project);
     $m->setRefid(new Reference("dummyref"));
     try {
         $m->setFrom("*.java");
         $this->fail("Can set from in Mapper that is a reference.");
     } catch (BuildException $be) {
         $this->assertEquals("You must not specify more than one attribute when using refid", $be->getMessage());
     }
     $m = new Mapper($this->project);
     $m->setRefid(new Reference("dummyref"));
     try {
         $m->setTo("*.java");
         $this->fail("Can set to in Mapper that is a reference.");
     } catch (BuildException $be) {
         $this->assertEquals("You must not specify more than one attribute when using refid", $be->getMessage());
     }
     try {
         $m = new Mapper($this->project);
         $m->setRefid(new Reference("dummyref"));
         $m->setType("glob");
         $this->fail("Can set type in Mapper that is a reference.");
     } catch (BuildException $be) {
         $this->assertEquals("You must not specify more than one attribute when using refid", $be->getMessage());
     }
 }