public function testParserReturnsBccWithOne() { $input = file_get_contents(__DIR__ . '/stubs/inbound_bcc_one.json'); $parser = new Parser($input); $output = ['body' => '<h1>Hello</h1>', 'subject' => 'This is an inbound message', 'to' => '*****@*****.**', 'from' => '*****@*****.**', 'replyTo' => '*****@*****.**', 'bcc' => '*****@*****.**']; $this->assertEquals($parser->parse(), $output); }
/** * Register the service provider. * * @return void */ public function register() { $this->app['postmarkEmail'] = $this->app->share(function ($app) { $parser = new Parser($app["Input"]->get()); // Create an instance of the parser with the given input return new Email($parser->parse()); // Returns an instance of the given email as an Email object }); }