diff --git a/tests/Controller/SecurityTest.php b/tests/Controller/SecurityTest.php index f5e2c1b30c..cbe8b52157 100644 --- a/tests/Controller/SecurityTest.php +++ b/tests/Controller/SecurityTest.php @@ -49,7 +49,7 @@ class SecurityTest extends GNUsocialTestCase $this->assertResponseIsSuccessful(); $this->assertSelectorNotExists('.alert'); $this->assertRouteSame('main_all'); - $this->assertSelectorTextContains('.info b', $nickname); + $this->assertSelectorTextContains('#user-nick', $nickname); } public function testLoginAttemptAlreadyLoggedIn() @@ -74,7 +74,7 @@ class SecurityTest extends GNUsocialTestCase $this->assertResponseIsSuccessful(); $this->assertSelectorNotExists('.alert'); $this->assertRouteSame('main_all'); - $this->assertSelectorTextContains('.info b', 'taken_user'); + $this->assertSelectorTextContains('#user-nick', 'taken_user'); } // --------- Register -------------- @@ -101,7 +101,7 @@ class SecurityTest extends GNUsocialTestCase $this->assertResponseIsSuccessful(); $this->assertSelectorNotExists('.alert'); $this->assertRouteSame('main_all'); - $this->assertSelectorTextContains('.info b', 'new_nickname'); + $this->assertSelectorTextContains('#user-nick', 'new_nickname'); } public function testRegisterDifferentPassword() @@ -124,11 +124,11 @@ class SecurityTest extends GNUsocialTestCase { self::testRegister('new_nickname', 'email@provider', $password); $this->assertResponseIsSuccessful(); - $this->assertSelectorTextContains('#register > div:nth-child(3) > ul > li', $error); + $this->assertSelectorTextContains('ul > li', $error); $this->assertRouteSame('register'); } - public function testRegisterPassowrdEmpty() + public function testRegisterPasswordEmpty() { self::testRegisterPasswordLength('', error: 'Please enter a password'); } @@ -147,7 +147,7 @@ class SecurityTest extends GNUsocialTestCase { self::testRegister('new_nickname', '', 'foobar'); $this->assertResponseIsSuccessful(); - $this->assertSelectorTextContains('#register > div:nth-child(2) > ul > li', 'Please enter an email'); + $this->assertSelectorTextContains('ul > li', 'Please enter an email'); $this->assertRouteSame('register'); } @@ -155,7 +155,7 @@ class SecurityTest extends GNUsocialTestCase { self::testRegister($nickname, 'email@provider', 'foobar'); $this->assertResponseIsSuccessful(); - $this->assertSelectorTextContains('#register > div:nth-child(1) > ul > li', $error); + $this->assertSelectorTextContains('ul > li', $error); $this->assertRouteSame('register'); } diff --git a/tests/Controller/UserPanelTest.php b/tests/Controller/UserPanelTest.php new file mode 100644 index 0000000000..364f9b2723 --- /dev/null +++ b/tests/Controller/UserPanelTest.php @@ -0,0 +1,46 @@ +. + +// }}} + +namespace App\Tests\Core; + +use App\Core\DB\DB; +use App\Util\GNUsocialTestCase; +use Symfony\Component\HttpFoundation\Request; + +class UserPanelTest extends GNUsocialTestCase +{ + // public function testPersonalInfo() + // { + // $client = static::createClient(); + // $user = DB::findOneBy('local_user', ['nickname' => 'form_test_user']); + // $client->loginUser($user); + + // $client->request('GET', '/settings'); + // $client->followRedirect(); + // $this->assertResponseIsSuccessful(); + // $this->assertRouteSame('settings_personal_info'); + // $crawler = $client->submitForm('Save', [ + // 'nickname' => 'form_test_user_new_nickname', + // 'full_name' => 'Form User', + // 'homepage' => '', + // ]); + // } +}