protected function getPathItBelongsTo(ImprovedClassSource $classSource) { foreach ($this->paths as $path) { if ($path->belongsTo($classSource->getFullName())) { return $path; } } throw new \Exception('Err 912123132: Cant find path that "' . $classSource->getFullName() . '" would belong to!'); }
public function let(Path $path, ImprovedClassSource $classSource) { $classSource->getFullName()->willReturn('Namespace\\ClassName'); $this->beConstructedWith($path, $classSource); }
public function getFileName() : string { return $this->path->getFileNameFor($this->classSource->getFullName()); }
public function it_will_create_file_resource(ImprovedClassSource $classSource, $path1) { $classSource->getFullName()->willReturn('Namespace\\ClassName'); $path1->belongsTo('Namespace\\ClassName')->willReturn(true); $this->create($classSource)->shouldReturnAnInstanceOf(FileResource::class); }