Skip to content

Commit

Permalink
Added missing test dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
drslump committed Oct 4, 2011
1 parent a27a21e commit f900cb9
Show file tree
Hide file tree
Showing 2 changed files with 218 additions and 0 deletions.
201 changes: 201 additions & 0 deletions tests/protos/complex.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
<?php
// DO NOT EDIT! Generated by Protobuf-PHP protoc plugin @package_version@
// Source: complex.proto
// Date: 2011-08-08 07:46:24

namespace tests\Complex {

class Enum {
const FOO = 1;
const BAR = 2;
const BAZ = 10;
}
}
namespace tests\Complex {

class Nested extends \DrSlump\Protobuf\Message {

/** @var string */
public $foo = null;


/** @var \Closure[] */
protected static $__extensions = array();

public static function descriptor()
{
$descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'tests.Complex.Nested');

// optional string foo = 1
$f = new \DrSlump\Protobuf\Field();
$f->number = 1;
$f->name = "foo";
$f->type = 9;
$f->rule = 1;
$descriptor->addField($f);

foreach (self::$__extensions as $cb) {
$descriptor->addField($cb(), true);
}

return $descriptor;
}

/**
* Check if <foo> has a value
*
* @return boolean
*/
public function hasFoo(){
return $this->_has(1);
}

/**
* Clear <foo> value
*
* @return \tests\Complex\Nested
*/
public function clearFoo(){
return $this->_clear(1);
}

/**
* Get <foo> value
*
* @return string
*/
public function getFoo(){
return $this->_get(1);
}

/**
* Set <foo> value
*
* @param string $value
* @return \tests\Complex\Nested
*/
public function setFoo( $value){
return $this->_set(1, $value);
}
}
}

namespace tests {

class Complex extends \DrSlump\Protobuf\Message {

/** @var int - \tests\Complex\Enum */
public $enum = null;

/** @var \tests\Complex\Nested */
public $nested = null;


/** @var \Closure[] */
protected static $__extensions = array();

public static function descriptor()
{
$descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'tests.Complex');

// optional .tests.Complex.Enum enum = 1
$f = new \DrSlump\Protobuf\Field();
$f->number = 1;
$f->name = "enum";
$f->type = 14;
$f->rule = 1;
$f->reference = '\tests\Complex\Enum';
$descriptor->addField($f);

// optional .tests.Complex.Nested nested = 2
$f = new \DrSlump\Protobuf\Field();
$f->number = 2;
$f->name = "nested";
$f->type = 11;
$f->rule = 1;
$f->reference = '\tests\Complex\Nested';
$descriptor->addField($f);

foreach (self::$__extensions as $cb) {
$descriptor->addField($cb(), true);
}

return $descriptor;
}

/**
* Check if <enum> has a value
*
* @return boolean
*/
public function hasEnum(){
return $this->_has(1);
}

/**
* Clear <enum> value
*
* @return \tests\Complex
*/
public function clearEnum(){
return $this->_clear(1);
}

/**
* Get <enum> value
*
* @return int - \tests\Complex\Enum
*/
public function getEnum(){
return $this->_get(1);
}

/**
* Set <enum> value
*
* @param int - \tests\Complex\Enum $value
* @return \tests\Complex
*/
public function setEnum( $value){
return $this->_set(1, $value);
}

/**
* Check if <nested> has a value
*
* @return boolean
*/
public function hasNested(){
return $this->_has(2);
}

/**
* Clear <nested> value
*
* @return \tests\Complex
*/
public function clearNested(){
return $this->_clear(2);
}

/**
* Get <nested> value
*
* @return \tests\Complex\Nested
*/
public function getNested(){
return $this->_get(2);
}

/**
* Set <nested> value
*
* @param \tests\Complex\Nested $value
* @return \tests\Complex
*/
public function setNested(\tests\Complex\Nested $value){
return $this->_set(2, $value);
}
}
}

17 changes: 17 additions & 0 deletions tests/protos/complex.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package tests;

message Complex {

enum Enum {
FOO = 1;
BAR = 2;
BAZ = 10;
}

message Nested {
optional string foo = 1;
}

optional Enum enum = 1;
optional Nested nested = 2;
}

0 comments on commit f900cb9

Please sign in to comment.