/** * @expectedException \Doctrine\Search\Exception\Driver\PropertyDoesNotExistsInMetadataException */ public function testLoadMetadataForClassAddValuesToMetadata() { $this->reflectionClass->expects($this->once())->method('getProperties')->will($this->returnValue(array())); $this->reader->expects($this->once())->method('getClassAnnotations')->will($this->returnValue(array(0, new TestSearchable(array())))); $this->classMetadata->expects($this->once())->method('getReflectionClass')->will($this->returnValue($this->reflectionClass)); $this->annotationDriver->loadMetadataForClass('Doctrine\\Tests\\Models\\Blog\\BlogPost', $this->classMetadata); }
/** * Testing specific server scenario configured in Job annotations as a simple server */ public function testCombinationServers() { $this->reflectionClass->expects($this->once())->method('getNamespaceName')->will($this->returnValue($this->classNamespace)); $this->reflectionClass->expects($this->exactly(2))->method('getName')->will($this->returnValue($this->className)); $this->reflectionClass->expects($this->once())->method('getFileName')->will($this->returnValue($this->fileName)); $this->reflectionClass->expects($this->once())->method('getMethods')->will($this->returnValue(array())); $this->reader->expects($this->never())->method('getMethodAnnotations'); $this->workAnnotation->servers = array('host' => '10.0.0.2', 'port' => '80'); $workerClass = new WorkerClass($this->workAnnotation, $this->reflectionClass, $this->reader, $this->servers, $this->defaultSettings); $this->assertEquals($workerClass->toArray(), array('namespace' => $this->classNamespace, 'className' => $this->className, 'fileName' => $this->fileName, 'callableName' => $this->className, 'description' => $workerClass::DEFAULT_DESCRIPTION, 'service' => null, 'servers' => array($this->workAnnotation->servers), 'iterations' => $this->defaultSettings['iterations'], 'minimumExecutionTime' => $this->defaultSettings['minimum_execution_time'], 'timeout' => $this->defaultSettings['timeout'], 'jobs' => array())); }