Skip to content

Commit

Permalink
[template] fixed test failure introduted from #8585
Browse files Browse the repository at this point in the history
  • Loading branch information
bronze1man committed Jul 27, 2013
1 parent 3dec4dd commit 4b7c3b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
@@ -1,6 +1,6 @@
<?php $method = strtoupper($method) ?>
<?php $form_method = $method === 'GET' || $method === 'POST' ? $method : 'POST' ?>
<form method="<?php echo strtolower($form_method) ?>" action="<?php echo $action ?>"<?php foreach ($attr as $k => $v) { printf(' %s="%s"', $view->escape($k), $view->escape($v)); } ?><?php if ($multipart): ?> enctype="multipart/form-data"<?php endif ?>>
<form name="<?php echo $form->vars['name'] ?>" method="<?php echo strtolower($form_method) ?>" action="<?php echo $action ?>"<?php foreach ($attr as $k => $v) { printf(' %s="%s"', $view->escape($k), $view->escape($v)); } ?><?php if ($multipart): ?> enctype="multipart/form-data"<?php endif ?>>
<?php if ($form_method !== $method): ?>
<input type="hidden" name="_method" value="<?php echo $method ?>" />
<?php endif ?>
8 changes: 4 additions & 4 deletions src/Symfony/Component/Form/Tests/AbstractLayoutTest.php
Expand Up @@ -1811,7 +1811,7 @@ public function testStartTag()

$html = $this->renderStart($form->createView());

$this->assertSame('<form method="get" action="http://example.com/directory">', $html);
$this->assertSame('<form name="form" method="get" action="http://example.com/directory">', $html);
}

public function testStartTagForPutRequest()
Expand Down Expand Up @@ -1843,7 +1843,7 @@ public function testStartTagWithOverriddenVars()
'action' => 'http://foo.com/directory'
));

$this->assertSame('<form method="post" action="http://foo.com/directory">', $html);
$this->assertSame('<form name="form" method="post" action="http://foo.com/directory">', $html);
}

public function testStartTagForMultipartForm()
Expand All @@ -1857,7 +1857,7 @@ public function testStartTagForMultipartForm()

$html = $this->renderStart($form->createView());

$this->assertSame('<form method="get" action="http://example.com/directory" enctype="multipart/form-data">', $html);
$this->assertSame('<form name="form" method="get" action="http://example.com/directory" enctype="multipart/form-data">', $html);
}

public function testStartTagWithExtraAttributes()
Expand All @@ -1871,6 +1871,6 @@ public function testStartTagWithExtraAttributes()
'attr' => array('class' => 'foobar'),
));

$this->assertSame('<form method="get" action="http://example.com/directory" class="foobar">', $html);
$this->assertSame('<form name="form" method="get" action="http://example.com/directory" class="foobar">', $html);
}
}

0 comments on commit 4b7c3b9

Please sign in to comment.