예제 #1
0
 public function setUp()
 {
     parent::setUp();
     // mock all the dependencies
     $this->hashgen = Mockery::mock(HashGeneratorInterface::class)->makePartial();
     $this->serializer = Mockery::mock(SerializerInterface::class)->makePartial();
     $this->http = Mockery::mock(HttpClientInterface::class)->makePartial();
     $this->logger = Mockery::mock(LoggerInterface::class);
     foreach (['log', 'debug', 'info', 'notice', 'warning', 'error'] as $log_level) {
         $this->logger->shouldReceive($log_level)->withAnyArgs();
     }
     $this->app_id = 'WEIXIN_APP_ID';
     $this->mch_id = 'WEIXIN_MERCHANT_ID';
     $this->secret = 'WEIXIN_HASH_SECRET';
     $this->client = new Client(['app_id' => $this->app_id, 'mch_id' => $this->mch_id, 'secret' => $this->secret, 'public_key_path' => '/path/to/public/key', 'private_key_path' => '/path/to/private/key']);
     $this->client->setLogger($this->logger);
     $this->client->setHttpClient($this->http);
     $this->client->setSerializer($this->serializer);
     $this->client->setHashGenerator($this->hashgen);
 }
 public function setUp()
 {
     parent::setUp();
     $this->client = Mockery::mock(ClientInterface::class)->makePartial();
     $this->command = new CreateUnifiedOrder($this->client);
 }
예제 #3
0
 public function setUp()
 {
     parent::setUp();
     $this->serializer = new XmlSerializer();
 }
예제 #4
0
 public function setUp()
 {
     parent::setUp();
     $this->secret = '192006250b4c09247ec02edce69f6a2d';
     $this->hashgen = new HashGenerator($this->secret);
 }