diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Tests/WallabagCoreTestCase.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Tests/WallabagCoreTestCase.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Tests/WallabagCoreTestCase.php b/src/Wallabag/CoreBundle/Tests/WallabagCoreTestCase.php new file mode 100644 index 00000000..e5096528 --- /dev/null +++ b/src/Wallabag/CoreBundle/Tests/WallabagCoreTestCase.php | |||
@@ -0,0 +1,32 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\CoreBundle\Tests; | ||
4 | |||
5 | use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | ||
6 | |||
7 | abstract class WallabagCoreTestCase extends WebTestCase | ||
8 | { | ||
9 | private $client = null; | ||
10 | |||
11 | public function getClient() | ||
12 | { | ||
13 | return $this->client; | ||
14 | } | ||
15 | |||
16 | public function setUp() | ||
17 | { | ||
18 | $this->client = static::createClient(); | ||
19 | } | ||
20 | |||
21 | public function logInAs($username) | ||
22 | { | ||
23 | $crawler = $this->client->request('GET', '/login'); | ||
24 | $form = $crawler->filter('button[type=submit]')->form(); | ||
25 | $data = array( | ||
26 | '_username' => $username, | ||
27 | '_password' => 'mypassword', | ||
28 | ); | ||
29 | |||
30 | $this->client->submit($form, $data); | ||
31 | } | ||
32 | } | ||