/** * @return void */ public function testCanEncodeObjectWithoutToArray() { $object = new stdClass; $object->string = 'foo'; $object->integer = 42; $this->assertEquals( 'd7:integeri42e6:string3:fooe', Rych_Bencode_Encoder::encode($object) ); }
/** * Proxy method to {@link Rych_Bencode_Encoder::encode()}. * * @uses Rych_Bencode_Encoder::encode() * @param mixed $valueToEncode * @return string */ public static function encode($valueToEncode) { return Rych_Bencode_Encoder::encode($valueToEncode); }