Skip to content

Commit

Permalink
Merge branch '2.7' into 2.8
Browse files Browse the repository at this point in the history
* 2.7:
  Fixed expectedException annotations
  Security and validators messages translation to Latvian
  [Form] FormView->isRendered() remove dead code and simplify the flow
  • Loading branch information
fabpot committed Sep 24, 2016
2 parents 732a363 + e4f498a commit b049d09
Show file tree
Hide file tree
Showing 6 changed files with 466 additions and 17 deletions.
Expand Up @@ -93,7 +93,7 @@ public function testMissingControllers($name)

try {
$parser->parse($name);
$this->fail('->parse() throws a \InvalidArgumentException if the string is in the valid format, but not matching class can be found');
$this->fail('->parse() throws a \InvalidArgumentException if the class is found but does not exist');
} catch (\Exception $e) {
$this->assertInstanceOf('\InvalidArgumentException', $e, '->parse() throws a \InvalidArgumentException if the class is found but does not exist');
}
Expand All @@ -108,7 +108,6 @@ public function getMissingControllersTest()
}

/**
* @expectedException
* @dataProvider getInvalidBundleNameTests
*/
public function testInvalidBundleName($bundleName, $suggestedBundleName)
Expand All @@ -117,6 +116,7 @@ public function testInvalidBundleName($bundleName, $suggestedBundleName)

try {
$parser->parse($bundleName);
$this->fail('->parse() throws a \InvalidArgumentException if the bundle does not exist');
} catch (\Exception $e) {
$this->assertInstanceOf('\InvalidArgumentException', $e, '->parse() throws a \InvalidArgumentException if the bundle does not exist');

Expand Down
6 changes: 2 additions & 4 deletions src/Symfony/Component/Asset/Tests/UrlPackageTest.php
Expand Up @@ -14,8 +14,6 @@
use Symfony\Component\Asset\UrlPackage;
use Symfony\Component\Asset\VersionStrategy\StaticVersionStrategy;
use Symfony\Component\Asset\VersionStrategy\EmptyVersionStrategy;
use Symfony\Component\Asset\Exception\InvalidArgumentException;
use Symfony\Component\Asset\Exception\LogicException;

class UrlPackageTest extends \PHPUnit_Framework_TestCase
{
Expand Down Expand Up @@ -79,15 +77,15 @@ public function getContextConfigs()
}

/**
* @expectedException LogicException
* @expectedException \Symfony\Component\Asset\Exception\LogicException
*/
public function testNoBaseUrls()
{
new UrlPackage(array(), new EmptyVersionStrategy());
}

/**
* @expectedException InvalidArgumentException
* @expectedException \Symfony\Component\Asset\Exception\InvalidArgumentException
*/
public function testWrongBaseUrl()
{
Expand Down
16 changes: 5 additions & 11 deletions src/Symfony/Component/Form/FormView.php
Expand Up @@ -65,23 +65,17 @@ public function __construct(FormView $parent = null)
*/
public function isRendered()
{
$hasChildren = 0 < count($this->children);

if (true === $this->rendered || !$hasChildren) {
if (true === $this->rendered || 0 === count($this->children)) {
return $this->rendered;
}

if ($hasChildren) {
foreach ($this->children as $child) {
if (!$child->isRendered()) {
return false;
}
foreach ($this->children as $child) {
if (!$child->isRendered()) {
return false;
}

return $this->rendered = true;
}

return false;
return $this->rendered = true;
}

/**
Expand Down
@@ -0,0 +1,71 @@
<?xml version="1.0"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="file.ext">
<body>
<trans-unit id="1">
<source>An authentication exception occurred.</source>
<target>Radās autentifikācijas kļūda.</target>
</trans-unit>
<trans-unit id="2">
<source>Authentication credentials could not be found.</source>
<target>Autentifikācijas dati nav atrasti.</target>
</trans-unit>
<trans-unit id="3">
<source>Authentication request could not be processed due to a system problem.</source>
<target>Autentifikācijas pieprasījums nevar tikt apstrādāts sistēmas problēmas dēļ.</target>
</trans-unit>
<trans-unit id="4">
<source>Invalid credentials.</source>
<target>Nederīgi autentifikācijas dati.</target>
</trans-unit>
<trans-unit id="5">
<source>Cookie has already been used by someone else.</source>
<target>Kāds cits jau izmantoja sīkdatni.</target>
</trans-unit>
<trans-unit id="6">
<source>Not privileged to request the resource.</source>
<target>Nav tiesību ši resursa izsaukšanai.</target>
</trans-unit>
<trans-unit id="7">
<source>Invalid CSRF token.</source>
<target>Nederīgs CSRF talons.</target>
</trans-unit>
<trans-unit id="8">
<source>Digest nonce has expired.</source>
<target>Vienreiz lietojamās atslēgas darbības laiks ir beidzies.</target>
</trans-unit>
<trans-unit id="9">
<source>No authentication provider found to support the authentication token.</source>
<target>Nav atrasts, autentifikācijas talonu atbalstošs, autentifikācijas sniedzējs.</target>
</trans-unit>
<trans-unit id="10">
<source>No session available, it either timed out or cookies are not enabled.</source>
<target>Sesija nav pieejama - vai nu tā beidzās, vai nu sīkdatnes nav iespējotas.</target>
</trans-unit>
<trans-unit id="11">
<source>No token could be found.</source>
<target>Nevar atrast nevienu talonu.</target>
</trans-unit>
<trans-unit id="12">
<source>Username could not be found.</source>
<target>Nevar atrast lietotājvārdu.</target>
</trans-unit>
<trans-unit id="13">
<source>Account has expired.</source>
<target>Konta derīguma termiņš ir beidzies.</target>
</trans-unit>
<trans-unit id="14">
<source>Credentials have expired.</source>
<target>Autentifikācijas datu derīguma termiņš ir beidzies.</target>
</trans-unit>
<trans-unit id="15">
<source>Account is disabled.</source>
<target>Konts ir atspējots.</target>
</trans-unit>
<trans-unit id="16">
<source>Account is locked.</source>
<target>Konts ir slēgts.</target>
</trans-unit>
</body>
</file>
</xliff>
@@ -0,0 +1,71 @@
<?xml version="1.0"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="file.ext">
<body>
<trans-unit id="1">
<source>An authentication exception occurred.</source>
<target>Radās autentifikācijas kļūda.</target>
</trans-unit>
<trans-unit id="2">
<source>Authentication credentials could not be found.</source>
<target>Autentifikācijas dati nav atrasti.</target>
</trans-unit>
<trans-unit id="3">
<source>Authentication request could not be processed due to a system problem.</source>
<target>Autentifikācijas pieprasījums nevar tikt apstrādāts sistēmas problēmas dēļ.</target>
</trans-unit>
<trans-unit id="4">
<source>Invalid credentials.</source>
<target>Nederīgi autentifikācijas dati.</target>
</trans-unit>
<trans-unit id="5">
<source>Cookie has already been used by someone else.</source>
<target>Kāds cits jau izmantoja sīkdatni.</target>
</trans-unit>
<trans-unit id="6">
<source>Not privileged to request the resource.</source>
<target>Nav tiesību ši resursa izsaukšanai.</target>
</trans-unit>
<trans-unit id="7">
<source>Invalid CSRF token.</source>
<target>Nederīgs CSRF talons.</target>
</trans-unit>
<trans-unit id="8">
<source>Digest nonce has expired.</source>
<target>Vienreiz lietojamās atslēgas darbības laiks ir beidzies.</target>
</trans-unit>
<trans-unit id="9">
<source>No authentication provider found to support the authentication token.</source>
<target>Nav atrasts, autentifikācijas talonu atbalstošs, autentifikācijas sniedzējs.</target>
</trans-unit>
<trans-unit id="10">
<source>No session available, it either timed out or cookies are not enabled.</source>
<target>Sesija nav pieejama - vai nu tā beidzās, vai nu sīkdatnes nav iespējotas.</target>
</trans-unit>
<trans-unit id="11">
<source>No token could be found.</source>
<target>Nevar atrast nevienu talonu.</target>
</trans-unit>
<trans-unit id="12">
<source>Username could not be found.</source>
<target>Nevar atrast lietotājvārdu.</target>
</trans-unit>
<trans-unit id="13">
<source>Account has expired.</source>
<target>Konta derīguma termiņš ir beidzies.</target>
</trans-unit>
<trans-unit id="14">
<source>Credentials have expired.</source>
<target>Autentifikācijas datu derīguma termiņš ir beidzies.</target>
</trans-unit>
<trans-unit id="15">
<source>Account is disabled.</source>
<target>Konts ir atspējots.</target>
</trans-unit>
<trans-unit id="16">
<source>Account is locked.</source>
<target>Konts ir slēgts.</target>
</trans-unit>
</body>
</file>
</xliff>

0 comments on commit b049d09

Please sign in to comment.