public function testConfiguration() { $method = self::getPrivateMethod('configuration'); $obj = new Sms(false); $method->invokeArgs($obj, []); $config = (include __DIR__ . '/../src/config/phpsms.php'); $this->assertCount(count($config['scheme']), Sms::scheme()); $this->assertCount(count($config['scheme']), Sms::config()); }
/** * register service provider */ public function register() { //merge configs $this->mergeConfigFrom(__DIR__ . '/../config/phpsms.php', 'phpsms'); Sms::scheme(config('phpsms.scheme', [])); Sms::config(config('phpsms.agents', [])); $this->app->singleton('PhpSms', function () { return new Sms(false); }); }
public function testUpdateAgentConfig() { $agent = Sms::getAgent('Luosimao'); $this->assertEquals('123', $agent->apikey); Sms::config('Luosimao', ['apikey' => '12345', 'data' => 'hello world']); $this->assertEquals('12345', $agent->apikey); $this->assertEquals('hello world', $agent->data); Sms::cleanConfig(); $this->assertEquals(null, $agent->apikey); $this->assertEquals(null, $agent->data); }