/** * Test for the get() method. * * @return void */ public function test_get() { $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(); $url = 'url'; $nonced_url = 'nonced_url'; Monkey\Functions::expect('wp_nonce_url')->with($url, $action, $name)->andReturn($nonced_url); $this->assertSame($nonced_url, $testee->get($url, $context)); }
/** * Test for the get() method. * * @return void */ public function test_get() { $testee = new Testee(); $action = 'action'; $name = 'name'; Monkey\Functions::when('sanitize_title_with_dashes')->returnArg(); $context = new Context($action, $name); $url = 'url'; $nonced_url = 'nonced_url'; Monkey\Functions::expect('wp_nonce_url')->with($url, $action, $name)->andReturn($nonced_url); $this->assertSame($nonced_url, $testee->get($url, $context)); }