/** * Test for the render() method. * * @return void */ public function test_render() { $testee = new Testee(); $action = 'action'; $name = 'name'; /** @var Context $context */ $context = Mockery::mock('Inpsyde\\Nonces\\Context')->shouldReceive('get_action')->andReturn($action)->shouldReceive('get_name')->andReturn($name)->getMock(); $nonce_field = 'nonce_field'; Monkey\Functions::expect('wp_nonce_field')->with($action, $name, false, false)->andReturn($nonce_field); $this->expectOutputString($nonce_field); $testee->render($context); }
/** * Test for the render() method. * * @return void */ public function test_render() { $testee = new Testee(); $action = 'action'; $name = 'name'; Monkey\Functions::when('sanitize_title_with_dashes')->returnArg(); $context = new Context($action, $name); $nonce_field = 'nonce_field'; Monkey\Functions::expect('wp_nonce_field')->with($action, $name, false, false)->andReturn($nonce_field); $this->expectOutputString($nonce_field); $testee->render($context); }