* * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. */ use \Studip\LinkButton; class LinkButtonTestCase extends \Codeception\Test\Unit { function testCreate() { $this->assertNotNull(LinkButton::create()); } function testCreateWithLabel() { $this->assertEquals('yes', '' . LinkButton::create('yes')); } function testCreateWithLabelAndUrl() { $this->assertEquals('yes', '' . LinkButton::create('yes', 'http://example.net')); } function testCreateWithLabelAndArray() { $this->assertEquals('yes', '' . LinkButton::create('yes', ['a' => 1, 'b' => 2])); } function testCreateWithLabelUrlAndArray() { $this->assertEquals('yes', '' . LinkButton::create('yes', 'http://example.net', ['a' => 1, 'b' => 2])); } function testCreateAccept() { $this->assertEquals('Übernehmen', '' . LinkButton::createAccept()); } function testCreateCancel() { $this->assertEquals('Abbrechen', '' . LinkButton::createCancel()); } function testCreatePreOrder() { $this->assertEquals('ok', '' . LinkButton::createPreOrder()); } function testCreateWithInsaneArguments() { $this->assertEquals('>ok<', '' . LinkButton::create('>ok<', 'http://example.net?m=&m=', ['mad' => 'tu"ff'])); } }