From a7a2d8d1bb842fe972a13234c6d6359f5ccb9f50 Mon Sep 17 00:00:00 2001 From: William DURAND Date: Sat, 16 Mar 2013 18:45:41 +0100 Subject: [PATCH] Fix tests Related to 43b8f898455b103f03752b544c828d98fb3f3f49 --- Tests/Extractor/ApiDocExtratorTest.php | 4 +-- Tests/Formatter/MarkdownFormatterTest.php | 4 +++ Tests/Formatter/SimpleFormatterTest.php | 35 ++++++++++++++++++----- 3 files changed, 34 insertions(+), 9 deletions(-) diff --git a/Tests/Extractor/ApiDocExtratorTest.php b/Tests/Extractor/ApiDocExtratorTest.php index 100bc8e..5213e9d 100644 --- a/Tests/Extractor/ApiDocExtratorTest.php +++ b/Tests/Extractor/ApiDocExtratorTest.php @@ -25,7 +25,7 @@ class ApiDocExtractorTest extends WebTestCase restore_error_handler(); $this->assertTrue(is_array($data)); - $this->assertCount(14, $data); + $this->assertCount(15, $data); foreach ($data as $d) { $this->assertTrue(is_array($d)); @@ -65,7 +65,7 @@ class ApiDocExtractorTest extends WebTestCase $this->assertFalse(isset($array2['filters'])); $this->assertEquals('Nelmio\ApiDocBundle\Tests\Fixtures\Form\TestType', $a2->getInput()); - $a3 = $data['10']['annotation']; + $a3 = $data['11']['annotation']; $this->assertTrue($a3->getHttps()); } diff --git a/Tests/Formatter/MarkdownFormatterTest.php b/Tests/Formatter/MarkdownFormatterTest.php index b46ba27..2c5bf06 100644 --- a/Tests/Formatter/MarkdownFormatterTest.php +++ b/Tests/Formatter/MarkdownFormatterTest.php @@ -157,6 +157,10 @@ _Action without HTTP verb_ +### `ANY` /authenticated ### + + + ### `POST` /jms-input-test ### _Testing JMS_ diff --git a/Tests/Formatter/SimpleFormatterTest.php b/Tests/Formatter/SimpleFormatterTest.php index eefef72..f56cf85 100644 --- a/Tests/Formatter/SimpleFormatterTest.php +++ b/Tests/Formatter/SimpleFormatterTest.php @@ -53,6 +53,7 @@ class SimpleFormatterTest extends WebTestCase '_format' => array('dataType' => '', 'description' => '', 'requirement' => ''), ), 'https' => false, + 'authentication' => false, ), 1 => array( @@ -79,6 +80,7 @@ class SimpleFormatterTest extends WebTestCase '_format' => array('dataType' => '', 'description' => '', 'requirement' => ''), ), 'https' => false, + 'authentication' => false, ), 2 => array( @@ -113,6 +115,7 @@ class SimpleFormatterTest extends WebTestCase '_format' => array('dataType' => '', 'description' => '', 'requirement' => ''), ), 'https' => false, + 'authentication' => false, ), 3 => array( @@ -147,6 +150,7 @@ class SimpleFormatterTest extends WebTestCase '_format' => array('dataType' => '', 'description' => '', 'requirement' => ''), ), 'https' => false, + 'authentication' => false, ), ), 'others' => @@ -167,6 +171,7 @@ class SimpleFormatterTest extends WebTestCase ), 'description' => 'create another test', 'https' => false, + 'authentication' => false, ), 1 => array( @@ -174,6 +179,7 @@ class SimpleFormatterTest extends WebTestCase 'uri' => '/any', 'description' => 'Action without HTTP verb', 'https' => false, + 'authentication' => false, ), 2 => array( @@ -185,8 +191,16 @@ class SimpleFormatterTest extends WebTestCase ), 'description' => 'Action without HTTP verb', 'https' => false, + 'authentication' => false, ), 3 => + array ( + 'method' => 'ANY', + 'uri' => '/authenticated', + 'https' => false, + 'authentication' => true, + ), + 4 => array( 'method' => 'POST', 'uri' => '/jms-input-test', @@ -279,8 +293,9 @@ With multiple lines.', ), 'description' => 'Testing JMS', 'https' => false, + 'authentication' => false, ), - 4 => + 5 => array( 'method' => 'GET', 'uri' => '/jms-return-test', @@ -294,8 +309,9 @@ With multiple lines.', ) ), 'https' => false, + 'authentication' => false, ), - 5 => + 6 => array( 'method' => 'ANY', 'uri' => '/my-commented/{id}/{page}', @@ -306,9 +322,10 @@ With multiple lines.', ), 'https' => false, 'description' => 'This method is useful to test if the getDocComment works.', - 'documentation' => "This method is useful to test if the getDocComment works.\nAnd, it supports multilines until the first '@' char." + 'documentation' => "This method is useful to test if the getDocComment works.\nAnd, it supports multilines until the first '@' char.", + 'authentication' => false, ), - 6 => + 7 => array( 'method' => 'ANY', 'uri' => '/secure-route', @@ -322,8 +339,9 @@ With multiple lines.', ), ), 'https' => true, + 'authentication' => false, ), - 7 => + 8 => array( 'method' => 'ANY', 'uri' => '/yet-another/{id}', @@ -332,8 +350,9 @@ With multiple lines.', 'id' => array('dataType' => '', 'description' => '', 'requirement' => '\d+') ), 'https' => false, + 'authentication' => false, ), - 8 => + 9 => array( 'method' => 'GET', 'uri' => '/z-action-with-query-param', @@ -342,8 +361,9 @@ With multiple lines.', 'page' => array('description' => 'Page of the overview.', 'requirement' => '\d+') ), 'https' => false, + 'authentication' => false, ), - 9 => + 10 => array( 'method' => 'POST', 'uri' => '/z-action-with-request-param', @@ -352,6 +372,7 @@ With multiple lines.', 'param1' => array('description' => 'Param1 description.', 'required' => true, 'dataType' => 'string', 'readonly' => false) ), 'https' => false, + 'authentication' => false, ), ), );