Skip to content
This repository has been archived by the owner on Jun 2, 2020. It is now read-only.

Commit

Permalink
Attempt to fix this $€&%#@ strange segmentation fault
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierstoval committed Feb 16, 2015
1 parent fa97d3f commit 82727cf
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
15 changes: 5 additions & 10 deletions Tests/Controller/TranslationControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,23 @@ public function testAdminAndExport()
{
$client = static::createClient();

/** @var Router $urlGenerator */
$urlGenerator = $client->getContainer()->get('router');

$crawler = $client->request("GET", '/admin/translations/');

$exportLink = $crawler->filter('div.container > h1 + a');
$translationsContainer = $crawler->filter('div.container .row > div.alert');

$this->assertContains('alert-danger', $translationsContainer->attr('class'));
$this->assertEquals($urlGenerator->generate('pierstoval_translation_export', array(), UrlGenerator::ABSOLUTE_URL), $exportLink->attr('href'));
$this->assertContains('/admin/translations/export', $exportLink->attr('href'));
$this->assertGreaterThan(0, $exportLink->count());

$crawler->clear();
$crawler = $client->click($exportLink->link('GET'));

$refreshLink = $urlGenerator->generate('pierstoval_translation_adminlist', array(), UrlGenerator::ABSOLUTE_PATH);
$refreshLink = '/admin/translations';
$this->assertContains('Redirecting to '.$refreshLink, $crawler->html());

$crawler->clear();
unset($crawler, $refreshLink, $client, $exportLink);
}

public function testTranslationListAndEdit()
Expand Down Expand Up @@ -93,11 +91,8 @@ public function testTranslationListAndEdit()

$form['translation['.$token.']'] = 'translated_element';
$crawler->clear();
$crawler = $client->submit($form);

$this->assertContains($translator->trans('translations_saved_count', array('%count%' => 1), 'pierstoval_translation', 'fr'), $crawler->html());

$crawler->clear();
unset($translator);
unset($crawler);
}

}
20 changes: 20 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,29 @@
</php>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./Command</directory>
<directory suffix=".php">./Controller</directory>
<directory suffix=".php">./DependencyInjection</directory>
<directory suffix=".php">./Doctrine</directory>
<directory suffix=".php">./Entity</directory>
<directory suffix=".php">./Listeners</directory>
<directory suffix=".php">./Repository</directory>
<directory suffix=".php">./Resources</directory>
<directory suffix=".php">./Translation</directory>
<directory suffix=".php">./Twig</directory>
<exclude>
<directory>./Admin</directory>
<directory>./build</directory>
<directory>./Tests</directory>
<directory>./vendor</directory>
</exclude>
</whitelist>
<blacklist>
<directory>./Admin</directory>
<directory>./vendor</directory>
<directory>./Tests</directory>
<directory>./build</directory>
</blacklist>
</filter>
</phpunit>

0 comments on commit 82727cf

Please sign in to comment.