From 75c5bed34171a9e952cea061386af2e4d79cecef Mon Sep 17 00:00:00 2001 From: Jeffrey van Rossum Date: Thu, 9 Sep 2021 14:17:41 +0200 Subject: [PATCH 1/5] Update mustache package to fix PHP 8 error. --- .gitignore | 4 +- composer.json | 4 +- posts-to-posts.php | 4 +- readme.txt | 13 +- vendor/mustache/mustache/.gitignore | 4 + vendor/mustache/mustache/.gitmodules | 6 + vendor/mustache/mustache/.travis.yml | 40 +- vendor/mustache/mustache/README.md | 1 + .../mustache/mustache/bin/build_bootstrap.php | 178 ++++++ vendor/mustache/mustache/composer.json | 4 +- .../mustache/src/Mustache/Autoloader.php | 18 +- .../mustache/mustache/src/Mustache/Cache.php | 2 +- .../src/Mustache/Cache/AbstractCache.php | 2 +- .../src/Mustache/Cache/FilesystemCache.php | 12 +- .../mustache/src/Mustache/Cache/NoopCache.php | 2 +- .../mustache/src/Mustache/Compiler.php | 73 ++- .../mustache/src/Mustache/Context.php | 6 +- .../mustache/mustache/src/Mustache/Engine.php | 82 ++- .../mustache/src/Mustache/Exception.php | 2 +- .../Exception/InvalidArgumentException.php | 2 +- .../src/Mustache/Exception/LogicException.php | 2 +- .../Mustache/Exception/RuntimeException.php | 2 +- .../Mustache/Exception/SyntaxException.php | 15 +- .../Exception/UnknownFilterException.php | 14 +- .../Exception/UnknownHelperException.php | 14 +- .../Exception/UnknownTemplateException.php | 14 +- .../src/Mustache/HelperCollection.php | 6 +- .../mustache/src/Mustache/LambdaHelper.php | 39 +- .../mustache/mustache/src/Mustache/Loader.php | 6 +- .../src/Mustache/Loader/ArrayLoader.php | 4 +- .../src/Mustache/Loader/CascadingLoader.php | 4 +- .../src/Mustache/Loader/FilesystemLoader.php | 23 +- .../src/Mustache/Loader/InlineLoader.php | 6 +- .../src/Mustache/Loader/MutableLoader.php | 2 +- .../Loader/ProductionFilesystemLoader.php | 86 +++ .../src/Mustache/Loader/StringLoader.php | 2 +- .../mustache/mustache/src/Mustache/Logger.php | 2 +- .../src/Mustache/Logger/AbstractLogger.php | 2 +- .../src/Mustache/Logger/StreamLogger.php | 14 +- .../mustache/mustache/src/Mustache/Parser.php | 16 +- .../mustache/mustache/src/Mustache/Source.php | 40 ++ .../src/Mustache/Source/FilesystemSource.php | 77 +++ .../mustache/src/Mustache/Template.php | 7 +- .../mustache/src/Mustache/Tokenizer.php | 100 ++-- .../test/Mustache/Test/AutoloaderTest.php | 51 ++ .../Mustache/Test/Cache/AbstractCacheTest.php | 44 ++ .../Test/Cache/FilesystemCacheTest.php | 36 ++ .../test/Mustache/Test/CompilerTest.php | 154 +++++ .../test/Mustache/Test/ContextTest.php | 282 +++++++++ .../test/Mustache/Test/EngineTest.php | 397 +++++++++++++ .../Test/Exception/SyntaxExceptionTest.php | 39 ++ .../Exception/UnknownFilterExceptionTest.php | 44 ++ .../Exception/UnknownHelperExceptionTest.php | 43 ++ .../UnknownTemplateExceptionTest.php | 43 ++ .../Functional/ClosureQuirksTest.php | 32 ++ .../Test/FiveThree/Functional/EngineTest.php | 50 ++ .../Test/FiveThree/Functional/FiltersTest.php | 187 ++++++ .../Functional/HigherOrderSectionsTest.php | 77 +++ .../FiveThree/Functional/LambdaHelperTest.php | 67 +++ .../FiveThree/Functional/MustacheSpecTest.php | 68 +++ .../Functional/PartialLambdaIndentTest.php | 94 +++ .../Functional/StrictCallablesTest.php | 135 +++++ .../Mustache/Test/Functional/CallTest.php | 40 ++ .../Mustache/Test/Functional/ExamplesTest.php | 142 +++++ .../Functional/HigherOrderSectionsTest.php | 177 ++++++ .../Test/Functional/InheritanceTest.php | 543 ++++++++++++++++++ .../Test/Functional/MustacheInjectionTest.php | 83 +++ .../Test/Functional/MustacheSpecTest.php | 121 ++++ .../Functional/NestedPartialIndentTest.php | 45 ++ .../Test/Functional/ObjectSectionTest.php | 110 ++++ .../test/Mustache/Test/FunctionalTestCase.php | 47 ++ .../Mustache/Test/HelperCollectionTest.php | 163 ++++++ .../Mustache/Test/Loader/ArrayLoaderTest.php | 52 ++ .../Test/Loader/CascadingLoaderTest.php | 40 ++ .../Test/Loader/FilesystemLoaderTest.php | 80 +++ .../Mustache/Test/Loader/InlineLoaderTest.php | 56 ++ .../Loader/ProductionFilesystemLoaderTest.php | 103 ++++ .../Mustache/Test/Loader/StringLoaderTest.php | 25 + .../Test/Logger/AbstractLoggerTest.php | 60 ++ .../Mustache/Test/Logger/StreamLoggerTest.php | 209 +++++++ .../test/Mustache/Test/ParserTest.php | 425 ++++++++++++++ .../Test/Source/FilesystemSourceTest.php | 25 + .../test/Mustache/Test/SpecTestCase.php | 67 +++ .../test/Mustache/Test/TemplateTest.php | 55 ++ .../test/Mustache/Test/TokenizerTest.php | 306 ++++++++++ vendor/mustache/mustache/test/bootstrap.php | 91 +++ .../test/fixtures/autoloader/Mustache/Bar.php | 15 + .../test/fixtures/autoloader/Mustache/Foo.php | 15 + .../fixtures/autoloader/NonMustacheClass.php | 15 + .../AnchoredDotNotation.php | 55 ++ .../anchored_dot_notation.mustache | 4 + .../anchored_dot_notation.txt | 11 + .../partials/genre.mustache | 5 + .../test/fixtures/examples/blocks/Blocks.php | 15 + .../fixtures/examples/blocks/blocks.mustache | 4 + .../test/fixtures/examples/blocks/blocks.txt | 3 + .../examples/blocks/partials/parent.mustache | 4 + .../examples/child_context/ChildContext.php | 23 + .../child_context/child_context.mustache | 2 + .../examples/child_context/child_context.txt | 2 + .../fixtures/examples/comments/Comments.php | 18 + .../examples/comments/comments.mustache | 1 + .../fixtures/examples/comments/comments.txt | 1 + .../examples/complex/complex.mustache | 16 + .../fixtures/examples/complex/complex.php | 31 + .../fixtures/examples/complex/complex.txt | 6 + .../examples/delimiters/Delimiters.php | 25 + .../examples/delimiters/delimiters.mustache | 8 + .../examples/delimiters/delimiters.txt | 4 + .../examples/dot_notation/DotNotation.php | 24 + .../dot_notation/dot_notation.mustache | 4 + .../examples/dot_notation/dot_notation.txt | 4 + .../examples/double_section/DoubleSection.php | 20 + .../double_section/double_section.mustache | 7 + .../double_section/double_section.txt | 3 + .../fixtures/examples/escaped/Escaped.php | 15 + .../examples/escaped/escaped.mustache | 1 + .../fixtures/examples/escaped/escaped.txt | 1 + .../fixtures/examples/filters/Filters.php | 97 ++++ .../examples/filters/filters.mustache | 4 + .../fixtures/examples/filters/filters.txt | 50 ++ .../GrandParentContext.php | 33 ++ .../grand_parent_context.mustache | 7 + .../grand_parent_context.txt | 7 + .../test/fixtures/examples/i18n/I18n.php | 30 + .../test/fixtures/examples/i18n/i18n.mustache | 1 + .../test/fixtures/examples/i18n/i18n.txt | 1 + .../implicit_iterator/ImplicitIterator.php | 15 + .../implicit_iterator.mustache | 3 + .../implicit_iterator/implicit_iterator.txt | 5 + .../InvertedDoubleSection.php | 16 + .../inverted_double_section.mustache | 7 + .../inverted_double_section.txt | 3 + .../inverted_section/InvertedSection.php | 15 + .../inverted_section.mustache | 6 + .../inverted_section/inverted_section.txt | 1 + .../nested_partials/NestedPartials.php | 15 + .../nested_partials/nested_partials.mustache | 3 + .../nested_partials/nested_partials.txt | 7 + .../nested_partials/partials/fourth.mustache | 1 + .../nested_partials/partials/second.mustache | 3 + .../nested_partials/partials/third.mustache | 3 + .../fixtures/examples/partials/Partials.php | 19 + .../examples/partials/partials.mustache | 7 + .../fixtures/examples/partials/partials.txt | 8 + .../partials/partials/header.mustache | 4 + .../recursive_partials/RecursivePartials.php | 22 + .../partials/child.mustache | 1 + .../recursive_partials.mustache | 1 + .../recursive_partials/recursive_partials.txt | 1 + .../SectionIteratorObjects.php | 27 + .../section_iterator_objects.mustache | 5 + .../section_iterator_objects.txt | 4 + .../SectionMagicObjects.php | 40 ++ .../section_magic_objects.mustache | 6 + .../section_magic_objects.txt | 4 + .../section_objects/SectionObjects.php | 28 + .../section_objects/section_objects.mustache | 6 + .../section_objects/section_objects.txt | 4 + .../fixtures/examples/sections/Sections.php | 25 + .../examples/sections/sections.mustache | 5 + .../fixtures/examples/sections/sections.txt | 4 + .../sections_nested/SectionsNested.php | 44 ++ .../sections_nested/sections_nested.mustache | 7 + .../sections_nested/sections_nested.txt | 12 + .../test/fixtures/examples/simple/Simple.php | 23 + .../fixtures/examples/simple/simple.mustache | 5 + .../test/fixtures/examples/simple/simple.txt | 3 + .../fixtures/examples/unescaped/Unescaped.php | 15 + .../examples/unescaped/unescaped.mustache | 1 + .../fixtures/examples/unescaped/unescaped.txt | 1 + .../test/fixtures/examples/utf8/UTF8.php | 15 + .../test/fixtures/examples/utf8/utf8.mustache | 1 + .../test/fixtures/examples/utf8/utf8.txt | 1 + .../examples/utf8_unescaped/UTF8Unescaped.php | 15 + .../utf8_unescaped/utf8_unescaped.mustache | 1 + .../utf8_unescaped/utf8_unescaped.txt | 1 + .../examples/whitespace/Whitespace.php | 43 ++ .../whitespace/partials/alphabet.mustache | 1 + .../examples/whitespace/whitespace.mustache | 10 + .../examples/whitespace/whitespace.txt | 12 + .../mustache/test/fixtures/templates/alpha.ms | 1 + .../mustache/test/fixtures/templates/beta.ms | 1 + .../test/fixtures/templates/one.mustache | 1 + .../test/fixtures/templates/two.mustache | 1 + vendor/scribu/lib-posts-to-posts/.gitignore | 2 + .../scribu/lib-posts-to-posts/side-post.php | 2 +- vendor/scribu/scb-framework/.gitignore | 1 + vendor/scribu/scb-framework/AdminPage.php | 4 +- vendor/scribu/scb-framework/Forms.php | 4 + vendor/scribu/scb-framework/load.php | 2 +- 191 files changed, 6809 insertions(+), 201 deletions(-) create mode 100644 vendor/mustache/mustache/.gitignore create mode 100644 vendor/mustache/mustache/.gitmodules create mode 100755 vendor/mustache/mustache/bin/build_bootstrap.php create mode 100644 vendor/mustache/mustache/src/Mustache/Loader/ProductionFilesystemLoader.php create mode 100644 vendor/mustache/mustache/src/Mustache/Source.php create mode 100644 vendor/mustache/mustache/src/Mustache/Source/FilesystemSource.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/AutoloaderTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/Cache/AbstractCacheTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/Cache/FilesystemCacheTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/CompilerTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/ContextTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/EngineTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/Exception/SyntaxExceptionTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/Exception/UnknownFilterExceptionTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/Exception/UnknownHelperExceptionTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/Exception/UnknownTemplateExceptionTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/ClosureQuirksTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/EngineTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/FiltersTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/HigherOrderSectionsTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/LambdaHelperTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/MustacheSpecTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/PartialLambdaIndentTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/StrictCallablesTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/Functional/CallTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/Functional/ExamplesTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/Functional/HigherOrderSectionsTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/Functional/InheritanceTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/Functional/MustacheInjectionTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/Functional/MustacheSpecTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/Functional/NestedPartialIndentTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/Functional/ObjectSectionTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/FunctionalTestCase.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/HelperCollectionTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/Loader/ArrayLoaderTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/Loader/CascadingLoaderTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/Loader/FilesystemLoaderTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/Loader/InlineLoaderTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/Loader/ProductionFilesystemLoaderTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/Loader/StringLoaderTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/Logger/AbstractLoggerTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/Logger/StreamLoggerTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/ParserTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/Source/FilesystemSourceTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/SpecTestCase.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/TemplateTest.php create mode 100644 vendor/mustache/mustache/test/Mustache/Test/TokenizerTest.php create mode 100644 vendor/mustache/mustache/test/bootstrap.php create mode 100644 vendor/mustache/mustache/test/fixtures/autoloader/Mustache/Bar.php create mode 100644 vendor/mustache/mustache/test/fixtures/autoloader/Mustache/Foo.php create mode 100644 vendor/mustache/mustache/test/fixtures/autoloader/NonMustacheClass.php create mode 100644 vendor/mustache/mustache/test/fixtures/examples/anchored_dot_notation/AnchoredDotNotation.php create mode 100644 vendor/mustache/mustache/test/fixtures/examples/anchored_dot_notation/anchored_dot_notation.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/anchored_dot_notation/anchored_dot_notation.txt create mode 100644 vendor/mustache/mustache/test/fixtures/examples/anchored_dot_notation/partials/genre.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/blocks/Blocks.php create mode 100644 vendor/mustache/mustache/test/fixtures/examples/blocks/blocks.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/blocks/blocks.txt create mode 100644 vendor/mustache/mustache/test/fixtures/examples/blocks/partials/parent.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/child_context/ChildContext.php create mode 100644 vendor/mustache/mustache/test/fixtures/examples/child_context/child_context.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/child_context/child_context.txt create mode 100644 vendor/mustache/mustache/test/fixtures/examples/comments/Comments.php create mode 100644 vendor/mustache/mustache/test/fixtures/examples/comments/comments.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/comments/comments.txt create mode 100644 vendor/mustache/mustache/test/fixtures/examples/complex/complex.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/complex/complex.php create mode 100644 vendor/mustache/mustache/test/fixtures/examples/complex/complex.txt create mode 100644 vendor/mustache/mustache/test/fixtures/examples/delimiters/Delimiters.php create mode 100644 vendor/mustache/mustache/test/fixtures/examples/delimiters/delimiters.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/delimiters/delimiters.txt create mode 100644 vendor/mustache/mustache/test/fixtures/examples/dot_notation/DotNotation.php create mode 100644 vendor/mustache/mustache/test/fixtures/examples/dot_notation/dot_notation.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/dot_notation/dot_notation.txt create mode 100644 vendor/mustache/mustache/test/fixtures/examples/double_section/DoubleSection.php create mode 100644 vendor/mustache/mustache/test/fixtures/examples/double_section/double_section.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/double_section/double_section.txt create mode 100644 vendor/mustache/mustache/test/fixtures/examples/escaped/Escaped.php create mode 100644 vendor/mustache/mustache/test/fixtures/examples/escaped/escaped.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/escaped/escaped.txt create mode 100644 vendor/mustache/mustache/test/fixtures/examples/filters/Filters.php create mode 100644 vendor/mustache/mustache/test/fixtures/examples/filters/filters.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/filters/filters.txt create mode 100644 vendor/mustache/mustache/test/fixtures/examples/grand_parent_context/GrandParentContext.php create mode 100644 vendor/mustache/mustache/test/fixtures/examples/grand_parent_context/grand_parent_context.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/grand_parent_context/grand_parent_context.txt create mode 100644 vendor/mustache/mustache/test/fixtures/examples/i18n/I18n.php create mode 100644 vendor/mustache/mustache/test/fixtures/examples/i18n/i18n.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/i18n/i18n.txt create mode 100644 vendor/mustache/mustache/test/fixtures/examples/implicit_iterator/ImplicitIterator.php create mode 100644 vendor/mustache/mustache/test/fixtures/examples/implicit_iterator/implicit_iterator.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/implicit_iterator/implicit_iterator.txt create mode 100644 vendor/mustache/mustache/test/fixtures/examples/inverted_double_section/InvertedDoubleSection.php create mode 100644 vendor/mustache/mustache/test/fixtures/examples/inverted_double_section/inverted_double_section.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/inverted_double_section/inverted_double_section.txt create mode 100644 vendor/mustache/mustache/test/fixtures/examples/inverted_section/InvertedSection.php create mode 100644 vendor/mustache/mustache/test/fixtures/examples/inverted_section/inverted_section.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/inverted_section/inverted_section.txt create mode 100644 vendor/mustache/mustache/test/fixtures/examples/nested_partials/NestedPartials.php create mode 100644 vendor/mustache/mustache/test/fixtures/examples/nested_partials/nested_partials.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/nested_partials/nested_partials.txt create mode 100644 vendor/mustache/mustache/test/fixtures/examples/nested_partials/partials/fourth.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/nested_partials/partials/second.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/nested_partials/partials/third.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/partials/Partials.php create mode 100644 vendor/mustache/mustache/test/fixtures/examples/partials/partials.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/partials/partials.txt create mode 100644 vendor/mustache/mustache/test/fixtures/examples/partials/partials/header.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/recursive_partials/RecursivePartials.php create mode 100644 vendor/mustache/mustache/test/fixtures/examples/recursive_partials/partials/child.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/recursive_partials/recursive_partials.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/recursive_partials/recursive_partials.txt create mode 100644 vendor/mustache/mustache/test/fixtures/examples/section_iterator_objects/SectionIteratorObjects.php create mode 100644 vendor/mustache/mustache/test/fixtures/examples/section_iterator_objects/section_iterator_objects.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/section_iterator_objects/section_iterator_objects.txt create mode 100644 vendor/mustache/mustache/test/fixtures/examples/section_magic_objects/SectionMagicObjects.php create mode 100644 vendor/mustache/mustache/test/fixtures/examples/section_magic_objects/section_magic_objects.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/section_magic_objects/section_magic_objects.txt create mode 100644 vendor/mustache/mustache/test/fixtures/examples/section_objects/SectionObjects.php create mode 100644 vendor/mustache/mustache/test/fixtures/examples/section_objects/section_objects.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/section_objects/section_objects.txt create mode 100644 vendor/mustache/mustache/test/fixtures/examples/sections/Sections.php create mode 100644 vendor/mustache/mustache/test/fixtures/examples/sections/sections.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/sections/sections.txt create mode 100644 vendor/mustache/mustache/test/fixtures/examples/sections_nested/SectionsNested.php create mode 100644 vendor/mustache/mustache/test/fixtures/examples/sections_nested/sections_nested.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/sections_nested/sections_nested.txt create mode 100644 vendor/mustache/mustache/test/fixtures/examples/simple/Simple.php create mode 100644 vendor/mustache/mustache/test/fixtures/examples/simple/simple.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/simple/simple.txt create mode 100644 vendor/mustache/mustache/test/fixtures/examples/unescaped/Unescaped.php create mode 100644 vendor/mustache/mustache/test/fixtures/examples/unescaped/unescaped.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/unescaped/unescaped.txt create mode 100644 vendor/mustache/mustache/test/fixtures/examples/utf8/UTF8.php create mode 100644 vendor/mustache/mustache/test/fixtures/examples/utf8/utf8.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/utf8/utf8.txt create mode 100644 vendor/mustache/mustache/test/fixtures/examples/utf8_unescaped/UTF8Unescaped.php create mode 100644 vendor/mustache/mustache/test/fixtures/examples/utf8_unescaped/utf8_unescaped.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/utf8_unescaped/utf8_unescaped.txt create mode 100644 vendor/mustache/mustache/test/fixtures/examples/whitespace/Whitespace.php create mode 100644 vendor/mustache/mustache/test/fixtures/examples/whitespace/partials/alphabet.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/whitespace/whitespace.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/examples/whitespace/whitespace.txt create mode 100644 vendor/mustache/mustache/test/fixtures/templates/alpha.ms create mode 100644 vendor/mustache/mustache/test/fixtures/templates/beta.ms create mode 100644 vendor/mustache/mustache/test/fixtures/templates/one.mustache create mode 100644 vendor/mustache/mustache/test/fixtures/templates/two.mustache create mode 100644 vendor/scribu/lib-posts-to-posts/.gitignore create mode 100644 vendor/scribu/scb-framework/.gitignore diff --git a/.gitignore b/.gitignore index 1fc34d88..5da1eec9 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,6 @@ # Composer composer.phar -composer.lock \ No newline at end of file +composer.lock +vendor/composer +vendor/autoload.php \ No newline at end of file diff --git a/composer.json b/composer.json index 35cb9f49..6f5e7345 100644 --- a/composer.json +++ b/composer.json @@ -6,6 +6,8 @@ "minimum-stability": "dev", "require": { "composer/installers": "~1.0", + "scribu/lib-posts-to-posts": "dev-master", + "mustache/mustache": "~2.6" }, "repositories": [ { @@ -13,4 +15,4 @@ "url": "https://github.com/scribu/wp-lib-posts-to-posts" } ] -} +} \ No newline at end of file diff --git a/posts-to-posts.php b/posts-to-posts.php index 5030d6fc..2b0915d9 100644 --- a/posts-to-posts.php +++ b/posts-to-posts.php @@ -2,7 +2,7 @@ /* Plugin Name: Posts 2 Posts Description: Create many-to-many relationships between all types of posts. -Version: 1.6.6 +Version: 1.6.7 Author: scribu Author URI: http://scribu.net/ Plugin URI: http://scribu.net/wordpress/posts-to-posts @@ -10,7 +10,7 @@ Domain Path: /lang */ -define( 'P2P_PLUGIN_VERSION', '1.6.6' ); +define( 'P2P_PLUGIN_VERSION', '1.6.7' ); define( 'P2P_TEXTDOMAIN', 'posts-to-posts' ); diff --git a/readme.txt b/readme.txt index 6df3bc05..02c9e95c 100644 --- a/readme.txt +++ b/readme.txt @@ -1,14 +1,14 @@ === Posts 2 Posts === Contributors: scribu, ciobi, ayecode, stiofansisland -Tags: connections, custom post types, relationships, many-to-many, users -Requires at least: 3.9 +Tags: connections, custom post types, relationships, many-to-many, users +Requires at least: 3.9 Requires PHP: 5.6 Tested up to: 5.4 Stable tag: 1.6.6 -License: GPLv2 or later -License URI: http://www.gnu.org/licenses/gpl-2.0.html +License: GPLv2 or later +License URI: http://www.gnu.org/licenses/gpl-2.0.html Efficient many-to-many connections between posts, pages, custom post types, users. @@ -42,7 +42,7 @@ Links: [**Documentation**](https://github.com/scribu/wp-posts-to-posts/wiki) | [P See [Installing Plugins](http://codex.wordpress.org/Managing_Plugins#Installing_Plugins). After activating it, refer to the [Basic usage](https://github.com/scribu/wp-posts-to-posts/wiki/Basic-usage) tutorial. - + Additional info can be found on the [wiki](https://github.com/scribu/wp-posts-to-posts/wiki). == Frequently Asked Questions == @@ -61,6 +61,9 @@ Additional info can be found on the [wiki](https://github.com/scribu/wp-posts-to- == Changelog == += 1.6.7 = +* Update Mustache package to support PHP 8. + = 1.6.6 = * AyeCode Ltd have committed to security and maintenance updates - INFO * Deprecated PHP notices showing with latest WordPress - FIXED diff --git a/vendor/mustache/mustache/.gitignore b/vendor/mustache/mustache/.gitignore new file mode 100644 index 00000000..3861f002 --- /dev/null +++ b/vendor/mustache/mustache/.gitignore @@ -0,0 +1,4 @@ +.php_cs.cache +composer.lock +mustache.php +vendor diff --git a/vendor/mustache/mustache/.gitmodules b/vendor/mustache/mustache/.gitmodules new file mode 100644 index 00000000..042ea4d3 --- /dev/null +++ b/vendor/mustache/mustache/.gitmodules @@ -0,0 +1,6 @@ +[submodule "vendor/spec"] + path = vendor/spec + url = https://github.com/mustache/spec.git +[submodule "vendor/yaml"] + path = vendor/yaml + url = https://github.com/fabpot/yaml.git diff --git a/vendor/mustache/mustache/.travis.yml b/vendor/mustache/mustache/.travis.yml index 7d3b7e5e..d88c6f00 100644 --- a/vendor/mustache/mustache/.travis.yml +++ b/vendor/mustache/mustache/.travis.yml @@ -1,19 +1,31 @@ language: php -install: - - curl http://get.sensiolabs.org/php-cs-fixer.phar -o php-cs-fixer.phar +sudo: false -script: - - phpunit - - if [[ `php -r "echo version_compare(PHP_VERSION, '5.3.6', '>=') && !defined('HHVM_VERSION');"` ]]; then php php-cs-fixer.phar --diff --dry-run -vv fix; fi +matrix: + include: + - php: 5.2 + dist: precise + - php: 5.3 + dist: precise + - php: 5.4 + dist: trusty + - php: 5.5 + dist: trusty + - php: 5.6 + - php: 7.0 + - php: 7.1 + - php: 7.2 + - php: 7.3 + - php: 7.4snapshot + - php: hhvm + dist: trusty + allow_failures: + - php: hhvm + - php: 7.4snapshot -php: - - 5.2 - - 5.3 - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - hhvm +script: + - '[[ "$TRAVIS_PHP_VERSION" = 5.2* ]] && phpunit || vendor/bin/phpunit --verbose' -sudo: false +install: + - '[[ "$TRAVIS_PHP_VERSION" = 5.2* ]] || composer install' diff --git a/vendor/mustache/mustache/README.md b/vendor/mustache/mustache/README.md index 6a309aee..a596ace8 100644 --- a/vendor/mustache/mustache/README.md +++ b/vendor/mustache/mustache/README.md @@ -5,6 +5,7 @@ A [Mustache](http://mustache.github.com/) implementation in PHP. [![Package version](http://img.shields.io/packagist/v/mustache/mustache.svg?style=flat-square)](https://packagist.org/packages/mustache/mustache) [![Build status](http://img.shields.io/travis/bobthecow/mustache.php/dev.svg?style=flat-square)](http://travis-ci.org/bobthecow/mustache.php) +[![StyleCI](https://styleci.io/repos/569670/shield)](https://styleci.io/repos/569670) [![Monthly downloads](http://img.shields.io/packagist/dm/mustache/mustache.svg?style=flat-square)](https://packagist.org/packages/mustache/mustache) diff --git a/vendor/mustache/mustache/bin/build_bootstrap.php b/vendor/mustache/mustache/bin/build_bootstrap.php new file mode 100755 index 00000000..cc23b2bd --- /dev/null +++ b/vendor/mustache/mustache/bin/build_bootstrap.php @@ -0,0 +1,178 @@ +#!/usr/bin/env php + + */ +class SymfonyClassCollectionLoader +{ + private static $loaded; + + const HEADER = <<<'EOS' +\s*$/'), '', file_get_contents($r->getFileName())); + } + + $cache = $cacheDir . '/' . $name . $extension; + $header = sprintf(self::HEADER, strftime('%Y')); + self::writeCacheFile($cache, $header . substr(self::stripComments('=5.2.4" }, "require-dev": { - "phpunit/phpunit": "~3.7|~4.0", - "fabpot/php-cs-fixer": "~1.6" + "phpunit/phpunit": "~3.7|~4.0|~5.0", + "friendsofphp/php-cs-fixer": "~1.11" }, "autoload": { "psr-0": { "Mustache": "src/" } diff --git a/vendor/mustache/mustache/src/Mustache/Autoloader.php b/vendor/mustache/mustache/src/Mustache/Autoloader.php index b33bc24f..e8ea3f4a 100644 --- a/vendor/mustache/mustache/src/Mustache/Autoloader.php +++ b/vendor/mustache/mustache/src/Mustache/Autoloader.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -16,6 +16,14 @@ class Mustache_Autoloader { private $baseDir; + /** + * An array where the key is the baseDir and the key is an instance of this + * class. + * + * @var array + */ + private static $instances; + /** * Autoloader constructor. * @@ -45,7 +53,13 @@ public function __construct($baseDir = null) */ public static function register($baseDir = null) { - $loader = new self($baseDir); + $key = $baseDir ? $baseDir : 0; + + if (!isset(self::$instances[$key])) { + self::$instances[$key] = new self($baseDir); + } + + $loader = self::$instances[$key]; spl_autoload_register(array($loader, 'autoload')); return $loader; diff --git a/vendor/mustache/mustache/src/Mustache/Cache.php b/vendor/mustache/mustache/src/Mustache/Cache.php index 5df8a23d..3b5b3f1b 100644 --- a/vendor/mustache/mustache/src/Mustache/Cache.php +++ b/vendor/mustache/mustache/src/Mustache/Cache.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/vendor/mustache/mustache/src/Mustache/Cache/AbstractCache.php b/vendor/mustache/mustache/src/Mustache/Cache/AbstractCache.php index cf1c0416..365eafac 100644 --- a/vendor/mustache/mustache/src/Mustache/Cache/AbstractCache.php +++ b/vendor/mustache/mustache/src/Mustache/Cache/AbstractCache.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/vendor/mustache/mustache/src/Mustache/Cache/FilesystemCache.php b/vendor/mustache/mustache/src/Mustache/Cache/FilesystemCache.php index 5b56222b..3e742b70 100644 --- a/vendor/mustache/mustache/src/Mustache/Cache/FilesystemCache.php +++ b/vendor/mustache/mustache/src/Mustache/Cache/FilesystemCache.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -27,8 +27,8 @@ class Mustache_Cache_FilesystemCache extends Mustache_Cache_AbstractCache /** * Filesystem cache constructor. * - * @param string $baseDir Directory for compiled templates. - * @param int $fileMode Override default permissions for cache files. Defaults to using the system-defined umask. + * @param string $baseDir Directory for compiled templates + * @param int $fileMode Override default permissions for cache files. Defaults to using the system-defined umask */ public function __construct($baseDir, $fileMode = null) { @@ -108,9 +108,11 @@ private function buildDirectoryForFilename($fileName) ); @mkdir($dirName, 0777, true); + // @codeCoverageIgnoreStart if (!is_dir($dirName)) { throw new Mustache_Exception_RuntimeException(sprintf('Failed to create cache directory "%s".', $dirName)); } + // @codeCoverageIgnoreEnd } return $dirName; @@ -143,13 +145,17 @@ private function writeFile($fileName, $value) return; } + // @codeCoverageIgnoreStart $this->log( Mustache_Logger::ERROR, 'Unable to rename Mustache temp cache file: "{tempName}" -> "{fileName}"', array('tempName' => $tempFile, 'fileName' => $fileName) ); + // @codeCoverageIgnoreEnd } + // @codeCoverageIgnoreStart throw new Mustache_Exception_RuntimeException(sprintf('Failed to write cache file "%s".', $fileName)); + // @codeCoverageIgnoreEnd } } diff --git a/vendor/mustache/mustache/src/Mustache/Cache/NoopCache.php b/vendor/mustache/mustache/src/Mustache/Cache/NoopCache.php index 7a4b55b5..ed9eec9d 100644 --- a/vendor/mustache/mustache/src/Mustache/Cache/NoopCache.php +++ b/vendor/mustache/mustache/src/Mustache/Cache/NoopCache.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/vendor/mustache/mustache/src/Mustache/Compiler.php b/vendor/mustache/mustache/src/Mustache/Compiler.php index 7d5c96b5..610369ed 100644 --- a/vendor/mustache/mustache/src/Mustache/Compiler.php +++ b/vendor/mustache/mustache/src/Mustache/Compiler.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -75,7 +75,7 @@ public function setPragmas(array $pragmas) /** * Helper function for walking the Mustache token parse tree. * - * @throws Mustache_Exception_SyntaxException upon encountering unknown token types. + * @throws Mustache_Exception_SyntaxException upon encountering unknown token types * * @param array $tree Parse tree of Mustache tokens * @param int $level (default: 0) @@ -191,7 +191,6 @@ public function renderInternal(Mustache_Context $context, $indent = \'\') { $this->lambdaHelper = new Mustache_LambdaHelper($this->mustache, $context); $buffer = \'\'; - $newContext = array(); %s return $buffer; @@ -207,7 +206,6 @@ class %s extends Mustache_Template public function renderInternal(Mustache_Context $context, $indent = \'\') { $buffer = \'\'; - $newContext = array(); %s return $buffer; @@ -240,10 +238,11 @@ private function writeCode($tree, $name) $blockFunction = $context->findInBlock(%s); if (is_callable($blockFunction)) { $buffer .= call_user_func($blockFunction, $context); - } else {%s - } + %s} '; + const BLOCK_VAR_ELSE = '} else {%s'; + /** * Generate Mustache Template inheritance block variable PHP source. * @@ -261,10 +260,15 @@ private function blockVar($nodes, $id, $start, $end, $otag, $ctag, $level) { $id = var_export($id, true); - return sprintf($this->prepare(self::BLOCK_VAR, $level), $id, $this->walk($nodes, $level)); + $else = $this->walk($nodes, $level); + if ($else !== '') { + $else = sprintf($this->prepare(self::BLOCK_VAR_ELSE, $level + 1, false, true), $else); + } + + return sprintf($this->prepare(self::BLOCK_VAR, $level), $id, $else); } - const BLOCK_ARG = '$newContext[%s] = array($this, \'block%s\');'; + const BLOCK_ARG = '%s => array($this, \'block%s\'),'; /** * Generate Mustache Template inheritance block argument PHP source. @@ -285,7 +289,7 @@ private function blockArg($nodes, $id, $start, $end, $otag, $ctag, $level) $keystr = var_export($key, true); $id = var_export($id, true); - return sprintf($this->prepare(self::BLOCK_ARG, 1), $id, $key); + return sprintf($this->prepare(self::BLOCK_ARG, $level), $id, $key); } const BLOCK_FUNCTION = ' @@ -326,9 +330,10 @@ private function block($nodes) private function section%s(Mustache_Context $context, $indent, $value) { $buffer = \'\'; + if (%s) { $source = %s; - $result = call_user_func($value, $source, $this->lambdaHelper); + $result = call_user_func($value, $source, %s); if (strpos($result, \'{{\') === false) { $buffer .= $result; } else { @@ -360,36 +365,34 @@ private function section%s(Mustache_Context $context, $indent, $value) * @param string $otag Current Mustache opening tag * @param string $ctag Current Mustache closing tag * @param int $level - * @param bool $arg (default: false) * * @return string Generated section PHP source code */ - private function section($nodes, $id, $filters, $start, $end, $otag, $ctag, $level, $arg = false) + private function section($nodes, $id, $filters, $start, $end, $otag, $ctag, $level) { $source = var_export(substr($this->source, $start, $end - $start), true); $callable = $this->getCallable(); if ($otag !== '{{' || $ctag !== '}}') { - $delims = ', ' . var_export(sprintf('{{= %s %s =}}', $otag, $ctag), true); + $delimTag = var_export(sprintf('{{= %s %s =}}', $otag, $ctag), true); + $helper = sprintf('$this->lambdaHelper->withDelimiters(%s)', $delimTag); + $delims = ', ' . $delimTag; } else { + $helper = '$this->lambdaHelper'; $delims = ''; } $key = ucfirst(md5($delims . "\n" . $source)); if (!isset($this->sections[$key])) { - $this->sections[$key] = sprintf($this->prepare(self::SECTION), $key, $callable, $source, $delims, $this->walk($nodes, 2)); + $this->sections[$key] = sprintf($this->prepare(self::SECTION), $key, $callable, $source, $helper, $delims, $this->walk($nodes, 2)); } - if ($arg === true) { - return $key; - } else { - $method = $this->getFindMethod($id); - $id = var_export($id, true); - $filters = $this->getFilters($filters, $level); + $method = $this->getFindMethod($id); + $id = var_export($id, true); + $filters = $this->getFilters($filters, $level); - return sprintf($this->prepare(self::SECTION_CALL, $level), $id, $method, $id, $filters, $key); - } + return sprintf($this->prepare(self::SECTION_CALL, $level), $id, $method, $id, $filters, $key); } const INVERTED_SECTION = ' @@ -451,15 +454,20 @@ private function partial($id, $indent, $level) } const PARENT = ' - %s - - if ($parent = $this->mustache->LoadPartial(%s)) { - $context->pushBlockContext($newContext); + if ($parent = $this->mustache->loadPartial(%s)) { + $context->pushBlockContext(array(%s + )); $buffer .= $parent->renderInternal($context, $indent); $context->popBlockContext(); } '; + const PARENT_NO_CONTEXT = ' + if ($parent = $this->mustache->loadPartial(%s)) { + $buffer .= $parent->renderInternal($context, $indent); + } + '; + /** * Generate Mustache Template inheritance parent call PHP source. * @@ -474,11 +482,14 @@ private function parent($id, $indent, array $children, $level) { $realChildren = array_filter($children, array(__CLASS__, 'onlyBlockArgs')); + if (empty($realChildren)) { + return sprintf($this->prepare(self::PARENT_NO_CONTEXT, $level), var_export($id, true)); + } + return sprintf( $this->prepare(self::PARENT, $level), - $this->walk($realChildren, $level), var_export($id, true), - var_export($indent, true) + $this->walk($realChildren, $level + 1) ); } @@ -487,7 +498,7 @@ private function parent($id, $indent, array $children, $level) * * @param array $node * - * @return bool True if $node is a block arg token. + * @return bool True if $node is a block arg token */ private static function onlyBlockArgs(array $node) { @@ -495,7 +506,7 @@ private static function onlyBlockArgs(array $node) } const VARIABLE = ' - $value = $this->resolveValue($context->%s(%s), $context, $indent);%s + $value = $this->resolveValue($context->%s(%s), $context);%s $buffer .= %s%s; '; @@ -615,7 +626,7 @@ private function getEscape($value = '$value') /** * Select the appropriate Context `find` method for a given $id. * - * The return value will be one of `find`, `findDot` or `last`. + * The return value will be one of `find`, `findDot`, `findAnchoredDot` or `last`. * * @see Mustache_Context::find * @see Mustache_Context::findDot diff --git a/vendor/mustache/mustache/src/Mustache/Context.php b/vendor/mustache/mustache/src/Mustache/Context.php index e660b543..69c02e01 100644 --- a/vendor/mustache/mustache/src/Mustache/Context.php +++ b/vendor/mustache/mustache/src/Mustache/Context.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -150,7 +150,7 @@ public function findDot($id) * * @see Mustache_Context::findDot * - * @throws Mustache_Exception_InvalidArgumentException if given an invalid anchored dot $id. + * @throws Mustache_Exception_InvalidArgumentException if given an invalid anchored dot $id * * @param string $id Dotted variable selector * @@ -182,7 +182,7 @@ public function findAnchoredDot($id) * * @param string $id * - * @return mixed Variable value, or '' if not found. + * @return mixed Variable value, or '' if not found */ public function findInBlock($id) { diff --git a/vendor/mustache/mustache/src/Mustache/Engine.php b/vendor/mustache/mustache/src/Mustache/Engine.php index 08bcc810..fe99799e 100644 --- a/vendor/mustache/mustache/src/Mustache/Engine.php +++ b/vendor/mustache/mustache/src/Mustache/Engine.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -23,7 +23,7 @@ */ class Mustache_Engine { - const VERSION = '2.9.0'; + const VERSION = '2.13.0'; const SPEC_VERSION = '1.1.2'; const PRAGMA_FILTERS = 'FILTERS'; @@ -54,6 +54,7 @@ class Mustache_Engine private $logger; private $strictCallables = false; private $pragmas = array(); + private $delimiters; // Services private $tokenizer; @@ -81,6 +82,14 @@ class Mustache_Engine * // sections are often too dynamic to benefit from caching. * 'cache_lambda_templates' => true, * + * // Customize the tag delimiters used by this engine instance. Note that overriding here changes the + * // delimiters used to parse all templates and partials loaded by this instance. To override just for a + * // single template, use an inline "change delimiters" tag at the start of the template file: + * // + * // {{=<% %>=}} + * // + * 'delimiters' => '<% %>', + * * // A Mustache template loader instance. Uses a StringLoader if not specified. * 'loader' => new Mustache_Loader_FilesystemLoader(dirname(__FILE__).'/views'), * @@ -126,13 +135,17 @@ class Mustache_Engine * 'pragmas' => [Mustache_Engine::PRAGMA_FILTERS], * ); * - * @throws Mustache_Exception_InvalidArgumentException If `escape` option is not callable. + * @throws Mustache_Exception_InvalidArgumentException If `escape` option is not callable * * @param array $options (default: array()) */ public function __construct(array $options = array()) { if (isset($options['template_class_prefix'])) { + if ((string) $options['template_class_prefix'] === '') { + throw new Mustache_Exception_InvalidArgumentException('Mustache Constructor "template_class_prefix" must not be empty'); + } + $this->templateClassPrefix = $options['template_class_prefix']; } @@ -191,6 +204,10 @@ public function __construct(array $options = array()) $this->strictCallables = $options['strict_callables']; } + if (isset($options['delimiters'])) { + $this->delimiters = $options['delimiters']; + } + if (isset($options['pragmas'])) { foreach ($options['pragmas'] as $pragma) { if (!isset(self::$knownPragmas[$pragma])) { @@ -429,7 +446,7 @@ public function removeHelper($name) /** * Set the Mustache Logger instance. * - * @throws Mustache_Exception_InvalidArgumentException If logger is not an instance of Mustache_Logger or Psr\Log\LoggerInterface. + * @throws Mustache_Exception_InvalidArgumentException If logger is not an instance of Mustache_Logger or Psr\Log\LoggerInterface * * @param Mustache_Logger|Psr\Log\LoggerInterface $logger */ @@ -589,22 +606,43 @@ protected function getLambdaCache() /** * Helper method to generate a Mustache template class. * - * @param string $source + * This method must be updated any time options are added which make it so + * the same template could be parsed and compiled multiple different ways. + * + * @param string|Mustache_Source $source * * @return string Mustache Template class name */ public function getTemplateClassName($source) { - return $this->templateClassPrefix . md5(sprintf( - 'version:%s,escape:%s,entity_flags:%i,charset:%s,strict_callables:%s,pragmas:%s,source:%s', - self::VERSION, - isset($this->escape) ? 'custom' : 'default', - $this->entityFlags, - $this->charset, - $this->strictCallables ? 'true' : 'false', - implode(' ', $this->getPragmas()), - $source - )); + // For the most part, adding a new option here should do the trick. + // + // Pick a value here which is unique for each possible way the template + // could be compiled... but not necessarily unique per option value. See + // escape below, which only needs to differentiate between 'custom' and + // 'default' escapes. + // + // Keep this list in alphabetical order :) + $chunks = array( + 'charset' => $this->charset, + 'delimiters' => $this->delimiters ? $this->delimiters : '{{ }}', + 'entityFlags' => $this->entityFlags, + 'escape' => isset($this->escape) ? 'custom' : 'default', + 'key' => ($source instanceof Mustache_Source) ? $source->getKey() : 'source', + 'pragmas' => $this->getPragmas(), + 'strictCallables' => $this->strictCallables, + 'version' => self::VERSION, + ); + + $key = json_encode($chunks); + + // Template Source instances have already provided their own source key. For strings, just include the whole + // source string in the md5 hash. + if (!$source instanceof Mustache_Source) { + $key .= "\n" . $source; + } + + return $this->templateClassPrefix . md5($key); } /** @@ -681,8 +719,8 @@ public function loadLambda($source, $delims = null) * @see Mustache_Engine::loadPartial * @see Mustache_Engine::loadLambda * - * @param string $source - * @param Mustache_Cache $cache (default: null) + * @param string|Mustache_Source $source + * @param Mustache_Cache $cache (default: null) * * @return Mustache_Template */ @@ -725,7 +763,7 @@ private function loadSource($source, Mustache_Cache $cache = null) */ private function tokenize($source) { - return $this->getTokenizer()->scan($source); + return $this->getTokenizer()->scan($source, $this->delimiters); } /** @@ -750,13 +788,12 @@ private function parse($source) * * @see Mustache_Compiler::compile * - * @param string $source + * @param string|Mustache_Source $source * * @return string generated Mustache template class code */ private function compile($source) { - $tree = $this->parse($source); $name = $this->getTemplateClassName($source); $this->log( @@ -765,6 +802,11 @@ private function compile($source) array('className' => $name) ); + if ($source instanceof Mustache_Source) { + $source = $source->getSource(); + } + $tree = $this->parse($source); + $compiler = $this->getCompiler(); $compiler->setPragmas($this->getPragmas()); diff --git a/vendor/mustache/mustache/src/Mustache/Exception.php b/vendor/mustache/mustache/src/Mustache/Exception.php index 7c047926..d4001a9b 100644 --- a/vendor/mustache/mustache/src/Mustache/Exception.php +++ b/vendor/mustache/mustache/src/Mustache/Exception.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/vendor/mustache/mustache/src/Mustache/Exception/InvalidArgumentException.php b/vendor/mustache/mustache/src/Mustache/Exception/InvalidArgumentException.php index c6084b8e..becf2ed1 100644 --- a/vendor/mustache/mustache/src/Mustache/Exception/InvalidArgumentException.php +++ b/vendor/mustache/mustache/src/Mustache/Exception/InvalidArgumentException.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/vendor/mustache/mustache/src/Mustache/Exception/LogicException.php b/vendor/mustache/mustache/src/Mustache/Exception/LogicException.php index 4bfda5f4..b2424d67 100644 --- a/vendor/mustache/mustache/src/Mustache/Exception/LogicException.php +++ b/vendor/mustache/mustache/src/Mustache/Exception/LogicException.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/vendor/mustache/mustache/src/Mustache/Exception/RuntimeException.php b/vendor/mustache/mustache/src/Mustache/Exception/RuntimeException.php index 5eb90ddd..b6369f4b 100644 --- a/vendor/mustache/mustache/src/Mustache/Exception/RuntimeException.php +++ b/vendor/mustache/mustache/src/Mustache/Exception/RuntimeException.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/vendor/mustache/mustache/src/Mustache/Exception/SyntaxException.php b/vendor/mustache/mustache/src/Mustache/Exception/SyntaxException.php index ab4d6aa8..b1879a3d 100644 --- a/vendor/mustache/mustache/src/Mustache/Exception/SyntaxException.php +++ b/vendor/mustache/mustache/src/Mustache/Exception/SyntaxException.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -17,13 +17,18 @@ class Mustache_Exception_SyntaxException extends LogicException implements Musta protected $token; /** - * @param string $msg - * @param array $token + * @param string $msg + * @param array $token + * @param Exception $previous */ - public function __construct($msg, array $token) + public function __construct($msg, array $token, Exception $previous = null) { $this->token = $token; - parent::__construct($msg); + if (version_compare(PHP_VERSION, '5.3.0', '>=')) { + parent::__construct($msg, 0, $previous); + } else { + parent::__construct($msg); // @codeCoverageIgnore + } } /** diff --git a/vendor/mustache/mustache/src/Mustache/Exception/UnknownFilterException.php b/vendor/mustache/mustache/src/Mustache/Exception/UnknownFilterException.php index 43d2c06d..0651c173 100644 --- a/vendor/mustache/mustache/src/Mustache/Exception/UnknownFilterException.php +++ b/vendor/mustache/mustache/src/Mustache/Exception/UnknownFilterException.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -17,12 +17,18 @@ class Mustache_Exception_UnknownFilterException extends UnexpectedValueException protected $filterName; /** - * @param string $filterName + * @param string $filterName + * @param Exception $previous */ - public function __construct($filterName) + public function __construct($filterName, Exception $previous = null) { $this->filterName = $filterName; - parent::__construct(sprintf('Unknown filter: %s', $filterName)); + $message = sprintf('Unknown filter: %s', $filterName); + if (version_compare(PHP_VERSION, '5.3.0', '>=')) { + parent::__construct($message, 0, $previous); + } else { + parent::__construct($message); // @codeCoverageIgnore + } } public function getFilterName() diff --git a/vendor/mustache/mustache/src/Mustache/Exception/UnknownHelperException.php b/vendor/mustache/mustache/src/Mustache/Exception/UnknownHelperException.php index 7fe4a71e..193be782 100644 --- a/vendor/mustache/mustache/src/Mustache/Exception/UnknownHelperException.php +++ b/vendor/mustache/mustache/src/Mustache/Exception/UnknownHelperException.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -17,12 +17,18 @@ class Mustache_Exception_UnknownHelperException extends InvalidArgumentException protected $helperName; /** - * @param string $helperName + * @param string $helperName + * @param Exception $previous */ - public function __construct($helperName) + public function __construct($helperName, Exception $previous = null) { $this->helperName = $helperName; - parent::__construct(sprintf('Unknown helper: %s', $helperName)); + $message = sprintf('Unknown helper: %s', $helperName); + if (version_compare(PHP_VERSION, '5.3.0', '>=')) { + parent::__construct($message, 0, $previous); + } else { + parent::__construct($message); // @codeCoverageIgnore + } } public function getHelperName() diff --git a/vendor/mustache/mustache/src/Mustache/Exception/UnknownTemplateException.php b/vendor/mustache/mustache/src/Mustache/Exception/UnknownTemplateException.php index f1f69bf3..32a778a5 100644 --- a/vendor/mustache/mustache/src/Mustache/Exception/UnknownTemplateException.php +++ b/vendor/mustache/mustache/src/Mustache/Exception/UnknownTemplateException.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -17,12 +17,18 @@ class Mustache_Exception_UnknownTemplateException extends InvalidArgumentExcepti protected $templateName; /** - * @param string $templateName + * @param string $templateName + * @param Exception $previous */ - public function __construct($templateName) + public function __construct($templateName, Exception $previous = null) { $this->templateName = $templateName; - parent::__construct(sprintf('Unknown template: %s', $templateName)); + $message = sprintf('Unknown template: %s', $templateName); + if (version_compare(PHP_VERSION, '5.3.0', '>=')) { + parent::__construct($message, 0, $previous); + } else { + parent::__construct($message); // @codeCoverageIgnore + } } public function getTemplateName() diff --git a/vendor/mustache/mustache/src/Mustache/HelperCollection.php b/vendor/mustache/mustache/src/Mustache/HelperCollection.php index 0a92428e..5d8f73c1 100644 --- a/vendor/mustache/mustache/src/Mustache/HelperCollection.php +++ b/vendor/mustache/mustache/src/Mustache/HelperCollection.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -81,7 +81,7 @@ public function __get($name) /** * Get a helper by name. * - * @throws Mustache_Exception_UnknownHelperException If helper does not exist. + * @throws Mustache_Exception_UnknownHelperException If helper does not exist * * @param string $name * @@ -137,7 +137,7 @@ public function __unset($name) /** * Check whether a given helper is present in the collection. * - * @throws Mustache_Exception_UnknownHelperException if the requested helper is not present. + * @throws Mustache_Exception_UnknownHelperException if the requested helper is not present * * @param string $name */ diff --git a/vendor/mustache/mustache/src/Mustache/LambdaHelper.php b/vendor/mustache/mustache/src/Mustache/LambdaHelper.php index de48fd63..e93dbfa3 100644 --- a/vendor/mustache/mustache/src/Mustache/LambdaHelper.php +++ b/vendor/mustache/mustache/src/Mustache/LambdaHelper.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -20,17 +20,20 @@ class Mustache_LambdaHelper { private $mustache; private $context; + private $delims; /** * Mustache Lambda Helper constructor. * - * @param Mustache_Engine $mustache Mustache engine instance. - * @param Mustache_Context $context Rendering context. + * @param Mustache_Engine $mustache Mustache engine instance + * @param Mustache_Context $context Rendering context + * @param string $delims Optional custom delimiters, in the format `{{= <% %> =}}`. (default: null) */ - public function __construct(Mustache_Engine $mustache, Mustache_Context $context) + public function __construct(Mustache_Engine $mustache, Mustache_Context $context, $delims = null) { $this->mustache = $mustache; $this->context = $context; + $this->delims = $delims; } /** @@ -38,12 +41,36 @@ public function __construct(Mustache_Engine $mustache, Mustache_Context $context * * @param string $string * - * @return string Rendered template. + * @return string Rendered template */ public function render($string) { return $this->mustache - ->loadLambda((string) $string) + ->loadLambda((string) $string, $this->delims) ->renderInternal($this->context); } + + /** + * Render a string as a Mustache template with the current rendering context. + * + * @param string $string + * + * @return string Rendered template + */ + public function __invoke($string) + { + return $this->render($string); + } + + /** + * Get a Lambda Helper with custom delimiters. + * + * @param string $delims Custom delimiters, in the format `{{= <% %> =}}` + * + * @return Mustache_LambdaHelper + */ + public function withDelimiters($delims) + { + return new self($this->mustache, $this->context, $delims); + } } diff --git a/vendor/mustache/mustache/src/Mustache/Loader.php b/vendor/mustache/mustache/src/Mustache/Loader.php index 1b075d05..23adba1a 100644 --- a/vendor/mustache/mustache/src/Mustache/Loader.php +++ b/vendor/mustache/mustache/src/Mustache/Loader.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -17,11 +17,11 @@ interface Mustache_Loader /** * Load a Template by name. * - * @throws Mustache_Exception_UnknownTemplateException If a template file is not found. + * @throws Mustache_Exception_UnknownTemplateException If a template file is not found * * @param string $name * - * @return string Mustache Template source + * @return string|Mustache_Source Mustache Template source */ public function load($name); } diff --git a/vendor/mustache/mustache/src/Mustache/Loader/ArrayLoader.php b/vendor/mustache/mustache/src/Mustache/Loader/ArrayLoader.php index 90cecca5..4276493a 100644 --- a/vendor/mustache/mustache/src/Mustache/Loader/ArrayLoader.php +++ b/vendor/mustache/mustache/src/Mustache/Loader/ArrayLoader.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -41,7 +41,7 @@ public function __construct(array $templates = array()) /** * Load a Template. * - * @throws Mustache_Exception_UnknownTemplateException If a template file is not found. + * @throws Mustache_Exception_UnknownTemplateException If a template file is not found * * @param string $name * diff --git a/vendor/mustache/mustache/src/Mustache/Loader/CascadingLoader.php b/vendor/mustache/mustache/src/Mustache/Loader/CascadingLoader.php index 09a376cd..3fb6353c 100644 --- a/vendor/mustache/mustache/src/Mustache/Loader/CascadingLoader.php +++ b/vendor/mustache/mustache/src/Mustache/Loader/CascadingLoader.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -48,7 +48,7 @@ public function addLoader(Mustache_Loader $loader) /** * Load a Template by name. * - * @throws Mustache_Exception_UnknownTemplateException If a template file is not found. + * @throws Mustache_Exception_UnknownTemplateException If a template file is not found * * @param string $name * diff --git a/vendor/mustache/mustache/src/Mustache/Loader/FilesystemLoader.php b/vendor/mustache/mustache/src/Mustache/Loader/FilesystemLoader.php index e2aab781..e366df70 100644 --- a/vendor/mustache/mustache/src/Mustache/Loader/FilesystemLoader.php +++ b/vendor/mustache/mustache/src/Mustache/Loader/FilesystemLoader.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -40,9 +40,9 @@ class Mustache_Loader_FilesystemLoader implements Mustache_Loader * 'extension' => '.ms', * ); * - * @throws Mustache_Exception_RuntimeException if $baseDir does not exist. + * @throws Mustache_Exception_RuntimeException if $baseDir does not exist * - * @param string $baseDir Base directory containing Mustache template files. + * @param string $baseDir Base directory containing Mustache template files * @param array $options Array of Loader options (default: array()) */ public function __construct($baseDir, array $options = array()) @@ -53,7 +53,7 @@ public function __construct($baseDir, array $options = array()) $this->baseDir = realpath($this->baseDir); } - if (!is_dir($this->baseDir)) { + if ($this->shouldCheckPath() && !is_dir($this->baseDir)) { throw new Mustache_Exception_RuntimeException(sprintf('FilesystemLoader baseDir must be a directory: %s', $baseDir)); } @@ -88,7 +88,7 @@ public function load($name) /** * Helper function for loading a Mustache file by name. * - * @throws Mustache_Exception_UnknownTemplateException If a template file is not found. + * @throws Mustache_Exception_UnknownTemplateException If a template file is not found * * @param string $name * @@ -98,7 +98,7 @@ protected function loadFile($name) { $fileName = $this->getFileName($name); - if (!file_exists($fileName)) { + if ($this->shouldCheckPath() && !file_exists($fileName)) { throw new Mustache_Exception_UnknownTemplateException($name); } @@ -121,4 +121,15 @@ protected function getFileName($name) return $fileName; } + + /** + * Only check if baseDir is a directory and requested templates are files if + * baseDir is using the filesystem stream wrapper. + * + * @return bool Whether to check `is_dir` and `file_exists` + */ + protected function shouldCheckPath() + { + return strpos($this->baseDir, '://') === false || strpos($this->baseDir, 'file://') === 0; + } } diff --git a/vendor/mustache/mustache/src/Mustache/Loader/InlineLoader.php b/vendor/mustache/mustache/src/Mustache/Loader/InlineLoader.php index 29709377..ae297fec 100644 --- a/vendor/mustache/mustache/src/Mustache/Loader/InlineLoader.php +++ b/vendor/mustache/mustache/src/Mustache/Loader/InlineLoader.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -68,7 +68,7 @@ class Mustache_Loader_InlineLoader implements Mustache_Loader * @param string $fileName The file to parse for inline templates * @param int $offset A string offset for the start of the templates. * This usually coincides with the `__halt_compiler` - * call, and the `__COMPILER_HALT_OFFSET__`. + * call, and the `__COMPILER_HALT_OFFSET__` */ public function __construct($fileName, $offset) { @@ -87,7 +87,7 @@ public function __construct($fileName, $offset) /** * Load a Template by name. * - * @throws Mustache_Exception_UnknownTemplateException If a template file is not found. + * @throws Mustache_Exception_UnknownTemplateException If a template file is not found * * @param string $name * diff --git a/vendor/mustache/mustache/src/Mustache/Loader/MutableLoader.php b/vendor/mustache/mustache/src/Mustache/Loader/MutableLoader.php index 4855c165..57fe5be3 100644 --- a/vendor/mustache/mustache/src/Mustache/Loader/MutableLoader.php +++ b/vendor/mustache/mustache/src/Mustache/Loader/MutableLoader.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/vendor/mustache/mustache/src/Mustache/Loader/ProductionFilesystemLoader.php b/vendor/mustache/mustache/src/Mustache/Loader/ProductionFilesystemLoader.php new file mode 100644 index 00000000..e7353327 --- /dev/null +++ b/vendor/mustache/mustache/src/Mustache/Loader/ProductionFilesystemLoader.php @@ -0,0 +1,86 @@ + '.ms', + * 'stat_props' => array('size', 'mtime'), + * ); + * + * Specifying 'stat_props' overrides the stat properties used to invalidate the template cache. By default, this + * uses 'mtime' and 'size', but this can be set to any of the properties supported by stat(): + * + * http://php.net/manual/en/function.stat.php + * + * You can also disable filesystem stat entirely: + * + * $options = array('stat_props' => null); + * + * But with great power comes great responsibility. Namely, if you disable stat-based cache invalidation, + * YOU MUST CLEAR THE TEMPLATE CACHE YOURSELF when your templates change. Make it part of your build or deploy + * process so you don't forget! + * + * @throws Mustache_Exception_RuntimeException if $baseDir does not exist. + * + * @param string $baseDir Base directory containing Mustache template files. + * @param array $options Array of Loader options (default: array()) + */ + public function __construct($baseDir, array $options = array()) + { + parent::__construct($baseDir, $options); + + if (array_key_exists('stat_props', $options)) { + if (empty($options['stat_props'])) { + $this->statProps = array(); + } else { + $this->statProps = $options['stat_props']; + } + } else { + $this->statProps = array('size', 'mtime'); + } + } + + /** + * Helper function for loading a Mustache file by name. + * + * @throws Mustache_Exception_UnknownTemplateException If a template file is not found. + * + * @param string $name + * + * @return Mustache_Source Mustache Template source + */ + protected function loadFile($name) + { + $fileName = $this->getFileName($name); + + if (!file_exists($fileName)) { + throw new Mustache_Exception_UnknownTemplateException($name); + } + + return new Mustache_Source_FilesystemSource($fileName, $this->statProps); + } +} diff --git a/vendor/mustache/mustache/src/Mustache/Loader/StringLoader.php b/vendor/mustache/mustache/src/Mustache/Loader/StringLoader.php index 99fb38e4..7012c03b 100644 --- a/vendor/mustache/mustache/src/Mustache/Loader/StringLoader.php +++ b/vendor/mustache/mustache/src/Mustache/Loader/StringLoader.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/vendor/mustache/mustache/src/Mustache/Logger.php b/vendor/mustache/mustache/src/Mustache/Logger.php index 93c27f6b..cb4037a2 100644 --- a/vendor/mustache/mustache/src/Mustache/Logger.php +++ b/vendor/mustache/mustache/src/Mustache/Logger.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/vendor/mustache/mustache/src/Mustache/Logger/AbstractLogger.php b/vendor/mustache/mustache/src/Mustache/Logger/AbstractLogger.php index 1c27db9c..a169f9c6 100644 --- a/vendor/mustache/mustache/src/Mustache/Logger/AbstractLogger.php +++ b/vendor/mustache/mustache/src/Mustache/Logger/AbstractLogger.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/vendor/mustache/mustache/src/Mustache/Logger/StreamLogger.php b/vendor/mustache/mustache/src/Mustache/Logger/StreamLogger.php index 88f30000..402a148e 100644 --- a/vendor/mustache/mustache/src/Mustache/Logger/StreamLogger.php +++ b/vendor/mustache/mustache/src/Mustache/Logger/StreamLogger.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -36,7 +36,7 @@ class Mustache_Logger_StreamLogger extends Mustache_Logger_AbstractLogger protected $url = null; /** - * @throws InvalidArgumentException if the logging level is unknown. + * @throws InvalidArgumentException if the logging level is unknown * * @param resource|string $stream Resource instance or URL * @param int $level The minimum logging level at which this handler will be triggered @@ -65,7 +65,7 @@ public function __destruct() /** * Set the minimum logging level. * - * @throws Mustache_Exception_InvalidArgumentException if the logging level is unknown. + * @throws Mustache_Exception_InvalidArgumentException if the logging level is unknown * * @param int $level The minimum logging level which will be written */ @@ -91,7 +91,7 @@ public function getLevel() /** * Logs with an arbitrary level. * - * @throws Mustache_Exception_InvalidArgumentException if the logging level is unknown. + * @throws Mustache_Exception_InvalidArgumentException if the logging level is unknown * * @param mixed $level * @param string $message @@ -111,8 +111,8 @@ public function log($level, $message, array $context = array()) /** * Write a record to the log. * - * @throws Mustache_Exception_LogicException If neither a stream resource nor url is present. - * @throws Mustache_Exception_RuntimeException If the stream url cannot be opened. + * @throws Mustache_Exception_LogicException If neither a stream resource nor url is present + * @throws Mustache_Exception_RuntimeException If the stream url cannot be opened * * @param int $level The logging level * @param string $message The log message @@ -139,7 +139,7 @@ protected function writeLog($level, $message, array $context = array()) /** * Gets the name of the logging level. * - * @throws InvalidArgumentException if the logging level is unknown. + * @throws InvalidArgumentException if the logging level is unknown * * @param int $level * diff --git a/vendor/mustache/mustache/src/Mustache/Parser.php b/vendor/mustache/mustache/src/Mustache/Parser.php index 7d3559b7..0ec41922 100644 --- a/vendor/mustache/mustache/src/Mustache/Parser.php +++ b/vendor/mustache/mustache/src/Mustache/Parser.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -63,7 +63,7 @@ public function setPragmas(array $pragmas) /** * Helper method for recursively building a parse tree. * - * @throws Mustache_Exception_SyntaxException when nesting errors or mismatched section tags are encountered. + * @throws Mustache_Exception_SyntaxException when nesting errors or mismatched section tags are encountered * * @param array &$tokens Set of Mustache tokens * @param array $parent Parent token (default: null) @@ -149,7 +149,7 @@ private function buildTree(array &$tokens, array $parent = null) case Mustache_Tokenizer::T_BLOCK_VAR: if ($this->pragmaBlocks) { // BLOCKS pragma is enabled, let's do this! - if ($parent[Mustache_Tokenizer::TYPE] === Mustache_Tokenizer::T_PARENT) { + if (isset($parent) && $parent[Mustache_Tokenizer::TYPE] === Mustache_Tokenizer::T_PARENT) { $token[Mustache_Tokenizer::TYPE] = Mustache_Tokenizer::T_BLOCK_ARG; } $this->clearStandaloneLines($nodes, $tokens); @@ -195,10 +195,10 @@ private function buildTree(array &$tokens, array $parent = null) * * Returns a whitespace token for indenting partials, if applicable. * - * @param array $nodes Parsed nodes. - * @param array $tokens Tokens to be parsed. + * @param array $nodes Parsed nodes + * @param array $tokens Tokens to be parsed * - * @return array|null Resulting indent token, if any. + * @return array|null Resulting indent token, if any */ private function clearStandaloneLines(array &$nodes, array &$tokens) { @@ -268,14 +268,14 @@ private function tokenIsWhitespace(array $token) /** * Check whether a token is allowed inside a parent tag. * - * @throws Mustache_Exception_SyntaxException if an invalid token is found inside a parent tag. + * @throws Mustache_Exception_SyntaxException if an invalid token is found inside a parent tag * * @param array|null $parent * @param array $token */ private function checkIfTokenIsAllowedInParent($parent, array $token) { - if ($parent[Mustache_Tokenizer::TYPE] === Mustache_Tokenizer::T_PARENT) { + if (isset($parent) && $parent[Mustache_Tokenizer::TYPE] === Mustache_Tokenizer::T_PARENT) { throw new Mustache_Exception_SyntaxException('Illegal content in < parent tag', $token); } } diff --git a/vendor/mustache/mustache/src/Mustache/Source.php b/vendor/mustache/mustache/src/Mustache/Source.php new file mode 100644 index 00000000..278c2cb3 --- /dev/null +++ b/vendor/mustache/mustache/src/Mustache/Source.php @@ -0,0 +1,40 @@ +fileName = $fileName; + $this->statProps = $statProps; + } + + /** + * Get the Source key (used to generate the compiled class name). + * + * @throws RuntimeException when a source file cannot be read + * + * @return string + */ + public function getKey() + { + $chunks = array( + 'fileName' => $this->fileName, + ); + + if (!empty($this->statProps)) { + if (!isset($this->stat)) { + $this->stat = @stat($this->fileName); + } + + if ($this->stat === false) { + throw new RuntimeException(sprintf('Failed to read source file "%s".', $this->fileName)); + } + + foreach ($this->statProps as $prop) { + $chunks[$prop] = $this->stat[$prop]; + } + } + + return json_encode($chunks); + } + + /** + * Get the template Source. + * + * @return string + */ + public function getSource() + { + return file_get_contents($this->fileName); + } +} diff --git a/vendor/mustache/mustache/src/Mustache/Template.php b/vendor/mustache/mustache/src/Mustache/Template.php index 91074c44..4de82393 100644 --- a/vendor/mustache/mustache/src/Mustache/Template.php +++ b/vendor/mustache/mustache/src/Mustache/Template.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -164,16 +164,15 @@ protected function prepareContextStack($context = null) * * @param mixed $value * @param Mustache_Context $context - * @param string $indent * * @return string */ - protected function resolveValue($value, Mustache_Context $context, $indent = '') + protected function resolveValue($value, Mustache_Context $context) { if (($this->strictCallables ? is_object($value) : !is_string($value)) && is_callable($value)) { return $this->mustache ->loadLambda((string) call_user_func($value)) - ->renderInternal($context, $indent); + ->renderInternal($context); } return $value; diff --git a/vendor/mustache/mustache/src/Mustache/Tokenizer.php b/vendor/mustache/mustache/src/Mustache/Tokenizer.php index a71df2ce..6dbe0cdf 100644 --- a/vendor/mustache/mustache/src/Mustache/Tokenizer.php +++ b/vendor/mustache/mustache/src/Mustache/Tokenizer.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -72,15 +72,20 @@ class Mustache_Tokenizer private $tokens; private $seenTag; private $line; + private $otag; - private $ctag; + private $otagChar; private $otagLen; + + private $ctag; + private $ctagChar; private $ctagLen; /** * Scan and tokenize template source. * - * @throws Mustache_Exception_SyntaxException when mismatched section tags are encountered. + * @throws Mustache_Exception_SyntaxException when mismatched section tags are encountered + * @throws Mustache_Exception_InvalidArgumentException when $delimiters string is invalid * * @param string $text Mustache template source to tokenize * @param string $delimiters Optionally, pass initial opening and closing delimiters (default: null) @@ -91,11 +96,14 @@ public function scan($text, $delimiters = null) { // Setting mbstring.func_overload makes things *really* slow. // Let's do everyone a favor and scan this string as ASCII instead. + // + // @codeCoverageIgnoreStart $encoding = null; if (function_exists('mb_internal_encoding') && ini_get('mbstring.func_overload') & 2) { $encoding = mb_internal_encoding(); mb_internal_encoding('ASCII'); } + // @codeCoverageIgnoreEnd $this->reset(); @@ -107,12 +115,13 @@ public function scan($text, $delimiters = null) for ($i = 0; $i < $len; $i++) { switch ($this->state) { case self::IN_TEXT: - if ($this->tagChange($this->otag, $this->otagLen, $text, $i)) { + $char = $text[$i]; + // Test whether it's time to change tags. + if ($char === $this->otagChar && substr($text, $i, $this->otagLen) === $this->otag) { $i--; $this->flushBuffer(); $this->state = self::IN_TAG_TYPE; } else { - $char = $text[$i]; $this->buffer .= $char; if ($char === "\n") { $this->flushBuffer(); @@ -148,7 +157,9 @@ public function scan($text, $delimiters = null) break; default: - if ($this->tagChange($this->ctag, $this->ctagLen, $text, $i)) { + $char = $text[$i]; + // Test whether it's time to change tags. + if ($char === $this->ctagChar && substr($text, $i, $this->ctagLen) === $this->ctag) { $token = array( self::TYPE => $this->tagType, self::NAME => trim($this->buffer), @@ -193,7 +204,7 @@ public function scan($text, $delimiters = null) $this->state = self::IN_TEXT; $this->tokens[] = $token; } else { - $this->buffer .= $text[$i]; + $this->buffer .= $char; } break; } @@ -202,9 +213,11 @@ public function scan($text, $delimiters = null) $this->flushBuffer(); // Restore the user's encoding... + // @codeCoverageIgnoreStart if ($encoding) { mb_internal_encoding($encoding); } + // @codeCoverageIgnoreEnd return $this->tokens; } @@ -214,16 +227,20 @@ public function scan($text, $delimiters = null) */ private function reset() { - $this->state = self::IN_TEXT; - $this->tagType = null; - $this->buffer = ''; - $this->tokens = array(); - $this->seenTag = false; - $this->line = 0; - $this->otag = '{{'; - $this->ctag = '}}'; - $this->otagLen = 2; - $this->ctagLen = 2; + $this->state = self::IN_TEXT; + $this->tagType = null; + $this->buffer = ''; + $this->tokens = array(); + $this->seenTag = false; + $this->line = 0; + + $this->otag = '{{'; + $this->otagChar = '{'; + $this->otagLen = 2; + + $this->ctag = '}}'; + $this->ctagChar = '}'; + $this->ctagLen = 2; } /** @@ -244,6 +261,8 @@ private function flushBuffer() /** * Change the current Mustache delimiters. Set new `otag` and `ctag` values. * + * @throws Mustache_Exception_SyntaxException when delimiter string is invalid + * * @param string $text Mustache template source * @param int $index Current tokenizer index * @@ -255,28 +274,44 @@ private function changeDelimiters($text, $index) $close = '=' . $this->ctag; $closeIndex = strpos($text, $close, $index); - $this->setDelimiters(trim(substr($text, $startIndex, $closeIndex - $startIndex))); - - $this->tokens[] = array( + $token = array( self::TYPE => self::T_DELIM_CHANGE, self::LINE => $this->line, ); + try { + $this->setDelimiters(trim(substr($text, $startIndex, $closeIndex - $startIndex))); + } catch (Mustache_Exception_InvalidArgumentException $e) { + throw new Mustache_Exception_SyntaxException($e->getMessage(), $token); + } + + $this->tokens[] = $token; + return $closeIndex + strlen($close) - 1; } /** * Set the current Mustache `otag` and `ctag` delimiters. * + * @throws Mustache_Exception_InvalidArgumentException when delimiter string is invalid + * * @param string $delimiters */ private function setDelimiters($delimiters) { - list($otag, $ctag) = explode(' ', $delimiters); - $this->otag = $otag; - $this->ctag = $ctag; - $this->otagLen = strlen($otag); - $this->ctagLen = strlen($ctag); + if (!preg_match('/^\s*(\S+)\s+(\S+)\s*$/', $delimiters, $matches)) { + throw new Mustache_Exception_InvalidArgumentException(sprintf('Invalid delimiters: %s', $delimiters)); + } + + list($_, $otag, $ctag) = $matches; + + $this->otag = $otag; + $this->otagChar = $otag[0]; + $this->otagLen = strlen($otag); + + $this->ctag = $ctag; + $this->ctagChar = $ctag[0]; + $this->ctagLen = strlen($ctag); } /** @@ -304,19 +339,4 @@ private function addPragma($text, $index) return $end + $this->ctagLen - 1; } - - /** - * Test whether it's time to change tags. - * - * @param string $tag Current tag name - * @param int $tagLen Current tag name length - * @param string $text Mustache template source - * @param int $index Current tokenizer index - * - * @return bool True if this is a closing section tag - */ - private function tagChange($tag, $tagLen, $text, $index) - { - return substr($text, $index, $tagLen) === $tag; - } } diff --git a/vendor/mustache/mustache/test/Mustache/Test/AutoloaderTest.php b/vendor/mustache/mustache/test/Mustache/Test/AutoloaderTest.php new file mode 100644 index 00000000..c72effef --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/AutoloaderTest.php @@ -0,0 +1,51 @@ +assertTrue(spl_autoload_unregister(array($loader, 'autoload'))); + } + + public function testAutoloader() + { + $loader = new Mustache_Autoloader(dirname(__FILE__) . '/../../fixtures/autoloader'); + + $this->assertNull($loader->autoload('NonMustacheClass')); + $this->assertFalse(class_exists('NonMustacheClass')); + + $loader->autoload('Mustache_Foo'); + $this->assertTrue(class_exists('Mustache_Foo')); + + $loader->autoload('\Mustache_Bar'); + $this->assertTrue(class_exists('Mustache_Bar')); + } + + /** + * Test that the autoloader won't register multiple times. + */ + public function testRegisterMultiple() + { + $numLoaders = count(spl_autoload_functions()); + + Mustache_Autoloader::register(); + Mustache_Autoloader::register(); + + $expectedNumLoaders = $numLoaders + 1; + + $this->assertCount($expectedNumLoaders, spl_autoload_functions()); + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Cache/AbstractCacheTest.php b/vendor/mustache/mustache/test/Mustache/Test/Cache/AbstractCacheTest.php new file mode 100644 index 00000000..ac47e64f --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/Cache/AbstractCacheTest.php @@ -0,0 +1,44 @@ +setLogger($logger); + $this->assertSame($logger, $cache->getLogger()); + } + + /** + * @expectedException Mustache_Exception_InvalidArgumentException + */ + public function testSetLoggerThrowsExceptions() + { + $cache = new CacheStub(); + $logger = new StdClass(); + $cache->setLogger($logger); + } +} + +class CacheStub extends Mustache_Cache_AbstractCache +{ + public function load($key) + { + // nada + } + + public function cache($key, $value) + { + // nada + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Cache/FilesystemCacheTest.php b/vendor/mustache/mustache/test/Mustache/Test/Cache/FilesystemCacheTest.php new file mode 100644 index 00000000..6bcc483d --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/Cache/FilesystemCacheTest.php @@ -0,0 +1,36 @@ +load($key); + + $this->assertFalse($loaded); + } + + public function testCachePut() + { + $key = 'some key'; + $value = 'cache($key, $value); + $loaded = $cache->load($key); + + $this->assertTrue($loaded); + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/CompilerTest.php b/vendor/mustache/mustache/test/Mustache/Test/CompilerTest.php new file mode 100644 index 00000000..6fd1986f --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/CompilerTest.php @@ -0,0 +1,154 @@ +compile($source, $tree, $name, $customEscaper, $charset, false, $entityFlags); + foreach ($expected as $contains) { + $this->assertContains($contains, $compiled); + } + } + + public function getCompileValues() + { + return array( + array('', array(), 'Banana', false, ENT_COMPAT, 'ISO-8859-1', array( + "\nclass Banana extends Mustache_Template", + 'return $buffer;', + )), + + array('', array($this->createTextToken('TEXT')), 'Monkey', false, ENT_COMPAT, 'UTF-8', array( + "\nclass Monkey extends Mustache_Template", + '$buffer .= $indent . \'TEXT\';', + 'return $buffer;', + )), + + array( + '', + array( + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, + Mustache_Tokenizer::NAME => 'name', + ), + ), + 'Monkey', + true, + ENT_COMPAT, + 'ISO-8859-1', + array( + "\nclass Monkey extends Mustache_Template", + '$value = $this->resolveValue($context->find(\'name\'), $context);', + '$buffer .= $indent . call_user_func($this->mustache->getEscape(), $value);', + 'return $buffer;', + ), + ), + + array( + '', + array( + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, + Mustache_Tokenizer::NAME => 'name', + ), + ), + 'Monkey', + false, + ENT_COMPAT, + 'ISO-8859-1', + array( + "\nclass Monkey extends Mustache_Template", + '$value = $this->resolveValue($context->find(\'name\'), $context);', + '$buffer .= $indent . htmlspecialchars($value, ' . ENT_COMPAT . ', \'ISO-8859-1\');', + 'return $buffer;', + ), + ), + + array( + '', + array( + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, + Mustache_Tokenizer::NAME => 'name', + ), + ), + 'Monkey', + false, + ENT_QUOTES, + 'ISO-8859-1', + array( + "\nclass Monkey extends Mustache_Template", + '$value = $this->resolveValue($context->find(\'name\'), $context);', + '$buffer .= $indent . htmlspecialchars($value, ' . ENT_QUOTES . ', \'ISO-8859-1\');', + 'return $buffer;', + ), + ), + + array( + '', + array( + $this->createTextToken("foo\n"), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, + Mustache_Tokenizer::NAME => 'name', + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, + Mustache_Tokenizer::NAME => '.', + ), + $this->createTextToken("'bar'"), + ), + 'Monkey', + false, + ENT_COMPAT, + 'UTF-8', + array( + "\nclass Monkey extends Mustache_Template", + "\$buffer .= \$indent . 'foo\n';", + '$value = $this->resolveValue($context->find(\'name\'), $context);', + '$buffer .= htmlspecialchars($value, ' . ENT_COMPAT . ', \'UTF-8\');', + '$value = $this->resolveValue($context->last(), $context);', + '$buffer .= \'\\\'bar\\\'\';', + 'return $buffer;', + ), + ), + ); + } + + /** + * @expectedException Mustache_Exception_SyntaxException + */ + public function testCompilerThrowsSyntaxException() + { + $compiler = new Mustache_Compiler(); + $compiler->compile('', array(array(Mustache_Tokenizer::TYPE => 'invalid')), 'SomeClass'); + } + + /** + * @param string $value + */ + private function createTextToken($value) + { + return array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, + Mustache_Tokenizer::VALUE => $value, + ); + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/ContextTest.php b/vendor/mustache/mustache/test/Mustache/Test/ContextTest.php new file mode 100644 index 00000000..447ea161 --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/ContextTest.php @@ -0,0 +1,282 @@ +assertSame('', $one->find('foo')); + $this->assertSame('', $one->find('bar')); + + $two = new Mustache_Context(array( + 'foo' => 'FOO', + 'bar' => '', + )); + $this->assertEquals('FOO', $two->find('foo')); + $this->assertEquals('', $two->find('bar')); + + $obj = new StdClass(); + $obj->name = 'NAME'; + $three = new Mustache_Context($obj); + $this->assertSame($obj, $three->last()); + $this->assertEquals('NAME', $three->find('name')); + } + + public function testPushPopAndLast() + { + $context = new Mustache_Context(); + $this->assertFalse($context->last()); + + $dummy = new Mustache_Test_TestDummy(); + $context->push($dummy); + $this->assertSame($dummy, $context->last()); + $this->assertSame($dummy, $context->pop()); + $this->assertFalse($context->last()); + + $obj = new StdClass(); + $context->push($dummy); + $this->assertSame($dummy, $context->last()); + $context->push($obj); + $this->assertSame($obj, $context->last()); + $this->assertSame($obj, $context->pop()); + $this->assertSame($dummy, $context->pop()); + $this->assertFalse($context->last()); + } + + public function testFind() + { + $context = new Mustache_Context(); + + $dummy = new Mustache_Test_TestDummy(); + + $obj = new StdClass(); + $obj->name = 'obj'; + + $arr = array( + 'a' => array('b' => array('c' => 'see')), + 'b' => 'bee', + ); + + $string = 'some arbitrary string'; + + $context->push($dummy); + $this->assertEquals('dummy', $context->find('name')); + + $context->push($obj); + $this->assertEquals('obj', $context->find('name')); + + $context->pop(); + $this->assertEquals('dummy', $context->find('name')); + + $dummy->name = 'dummyer'; + $this->assertEquals('dummyer', $context->find('name')); + + $context->push($arr); + $this->assertEquals('bee', $context->find('b')); + $this->assertEquals('see', $context->findDot('a.b.c')); + + $dummy->name = 'dummy'; + + $context->push($string); + $this->assertSame($string, $context->last()); + $this->assertEquals('dummy', $context->find('name')); + $this->assertEquals('see', $context->findDot('a.b.c')); + $this->assertEquals('', $context->find('foo')); + $this->assertEquals('', $context->findDot('bar')); + } + + public function testArrayAccessFind() + { + $access = new Mustache_Test_TestArrayAccess(array( + 'a' => array('b' => array('c' => 'see')), + 'b' => 'bee', + )); + + $context = new Mustache_Context($access); + $this->assertEquals('bee', $context->find('b')); + $this->assertEquals('see', $context->findDot('a.b.c')); + $this->assertEquals(null, $context->findDot('a.b.c.d')); + } + + public function testAccessorPriority() + { + $context = new Mustache_Context(new Mustache_Test_AllTheThings()); + + $this->assertEquals('win', $context->find('foo'), 'method beats property'); + $this->assertEquals('win', $context->find('bar'), 'property beats ArrayAccess'); + $this->assertEquals('win', $context->find('baz'), 'ArrayAccess stands alone'); + $this->assertEquals('win', $context->find('qux'), 'ArrayAccess beats private property'); + } + + public function testAnchoredDotNotation() + { + $context = new Mustache_Context(); + + $a = array( + 'name' => 'a', + 'number' => 1, + ); + + $b = array( + 'number' => 2, + 'child' => array( + 'name' => 'baby bee', + ), + ); + + $c = array( + 'name' => 'cee', + ); + + $context->push($a); + $this->assertEquals('a', $context->find('name')); + $this->assertEquals('', $context->findDot('.name')); + $this->assertEquals('a', $context->findAnchoredDot('.name')); + $this->assertEquals(1, $context->find('number')); + $this->assertEquals('', $context->findDot('.number')); + $this->assertEquals(1, $context->findAnchoredDot('.number')); + + $context->push($b); + $this->assertEquals('a', $context->find('name')); + $this->assertEquals(2, $context->find('number')); + $this->assertEquals('', $context->findDot('.name')); + $this->assertEquals('', $context->findDot('.number')); + $this->assertEquals('', $context->findAnchoredDot('.name')); + $this->assertEquals(2, $context->findAnchoredDot('.number')); + $this->assertEquals('baby bee', $context->findDot('child.name')); + $this->assertEquals('', $context->findDot('.child.name')); + $this->assertEquals('baby bee', $context->findAnchoredDot('.child.name')); + + $context->push($c); + $this->assertEquals('cee', $context->find('name')); + $this->assertEquals('', $context->findDot('.name')); + $this->assertEquals('cee', $context->findAnchoredDot('.name')); + $this->assertEquals(2, $context->find('number')); + $this->assertEquals('', $context->findDot('.number')); + $this->assertEquals('', $context->findAnchoredDot('.number')); + $this->assertEquals('baby bee', $context->findDot('child.name')); + $this->assertEquals('', $context->findDot('.child.name')); + $this->assertEquals('', $context->findAnchoredDot('.child.name')); + } + + /** + * @expectedException Mustache_Exception_InvalidArgumentException + */ + public function testAnchoredDotNotationThrowsExceptions() + { + $context = new Mustache_Context(); + $context->push(array('a' => 1)); + $context->findAnchoredDot('a'); + } +} + +class Mustache_Test_TestDummy +{ + public $name = 'dummy'; + + public function __invoke() + { + // nothing + } + + public static function foo() + { + return ''; + } + + public function bar() + { + return ''; + } +} + +class Mustache_Test_TestArrayAccess implements ArrayAccess +{ + private $container = array(); + + public function __construct($array) + { + foreach ($array as $key => $value) { + $this->container[$key] = $value; + } + } + + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } +} + +class Mustache_Test_AllTheThings implements ArrayAccess +{ + public $foo = 'fail'; + public $bar = 'win'; + private $qux = 'fail'; + + public function foo() + { + return 'win'; + } + + public function offsetExists($offset) + { + return true; + } + + public function offsetGet($offset) + { + switch ($offset) { + case 'foo': + case 'bar': + return 'fail'; + + case 'baz': + case 'qux': + return 'win'; + + default: + return 'lolwhut'; + } + } + + public function offsetSet($offset, $value) + { + // nada + } + + public function offsetUnset($offset) + { + // nada + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/EngineTest.php b/vendor/mustache/mustache/test/Mustache/Test/EngineTest.php new file mode 100644 index 00000000..3e4d193b --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/EngineTest.php @@ -0,0 +1,397 @@ + '__whot__', + 'cache' => self::$tempDir, + 'cache_file_mode' => 777, + 'logger' => $logger, + 'loader' => $loader, + 'partials_loader' => $partialsLoader, + 'partials' => array( + 'foo' => '{{ foo }}', + ), + 'helpers' => array( + 'foo' => array($this, 'getFoo'), + 'bar' => 'BAR', + ), + 'escape' => 'strtoupper', + 'entity_flags' => ENT_QUOTES, + 'charset' => 'ISO-8859-1', + 'pragmas' => array(Mustache_Engine::PRAGMA_FILTERS), + )); + + $this->assertSame($logger, $mustache->getLogger()); + $this->assertSame($loader, $mustache->getLoader()); + $this->assertSame($partialsLoader, $mustache->getPartialsLoader()); + $this->assertEquals('{{ foo }}', $partialsLoader->load('foo')); + $this->assertContains('__whot__', $mustache->getTemplateClassName('{{ foo }}')); + $this->assertEquals('strtoupper', $mustache->getEscape()); + $this->assertEquals(ENT_QUOTES, $mustache->getEntityFlags()); + $this->assertEquals('ISO-8859-1', $mustache->getCharset()); + $this->assertTrue($mustache->hasHelper('foo')); + $this->assertTrue($mustache->hasHelper('bar')); + $this->assertFalse($mustache->hasHelper('baz')); + $this->assertInstanceOf('Mustache_Cache_FilesystemCache', $mustache->getCache()); + $this->assertEquals(array(Mustache_Engine::PRAGMA_FILTERS), $mustache->getPragmas()); + } + + public static function getFoo() + { + return 'foo'; + } + + public function testRender() + { + $source = '{{ foo }}'; + $data = array('bar' => 'baz'); + $output = 'TEH OUTPUT'; + + $template = $this->getMockBuilder('Mustache_Template') + ->disableOriginalConstructor() + ->getMock(); + + $mustache = new MustacheStub(); + $mustache->template = $template; + + $template->expects($this->once()) + ->method('render') + ->with($data) + ->will($this->returnValue($output)); + + $this->assertEquals($output, $mustache->render($source, $data)); + $this->assertEquals($source, $mustache->source); + } + + public function testSettingServices() + { + $logger = new Mustache_Logger_StreamLogger(tmpfile()); + $loader = new Mustache_Loader_StringLoader(); + $tokenizer = new Mustache_Tokenizer(); + $parser = new Mustache_Parser(); + $compiler = new Mustache_Compiler(); + $mustache = new Mustache_Engine(); + $cache = new Mustache_Cache_FilesystemCache(self::$tempDir); + + $this->assertNotSame($logger, $mustache->getLogger()); + $mustache->setLogger($logger); + $this->assertSame($logger, $mustache->getLogger()); + + $this->assertNotSame($loader, $mustache->getLoader()); + $mustache->setLoader($loader); + $this->assertSame($loader, $mustache->getLoader()); + + $this->assertNotSame($loader, $mustache->getPartialsLoader()); + $mustache->setPartialsLoader($loader); + $this->assertSame($loader, $mustache->getPartialsLoader()); + + $this->assertNotSame($tokenizer, $mustache->getTokenizer()); + $mustache->setTokenizer($tokenizer); + $this->assertSame($tokenizer, $mustache->getTokenizer()); + + $this->assertNotSame($parser, $mustache->getParser()); + $mustache->setParser($parser); + $this->assertSame($parser, $mustache->getParser()); + + $this->assertNotSame($compiler, $mustache->getCompiler()); + $mustache->setCompiler($compiler); + $this->assertSame($compiler, $mustache->getCompiler()); + + $this->assertNotSame($cache, $mustache->getCache()); + $mustache->setCache($cache); + $this->assertSame($cache, $mustache->getCache()); + } + + /** + * @group functional + */ + public function testCache() + { + $mustache = new Mustache_Engine(array( + 'template_class_prefix' => '__whot__', + 'cache' => self::$tempDir, + )); + + $source = '{{ foo }}'; + $template = $mustache->loadTemplate($source); + $className = $mustache->getTemplateClassName($source); + + $this->assertInstanceOf($className, $template); + } + + public function testLambdaCache() + { + $mustache = new MustacheStub(array( + 'cache' => self::$tempDir, + 'cache_lambda_templates' => true, + )); + + $this->assertNotInstanceOf('Mustache_Cache_NoopCache', $mustache->getProtectedLambdaCache()); + $this->assertSame($mustache->getCache(), $mustache->getProtectedLambdaCache()); + } + + public function testWithoutLambdaCache() + { + $mustache = new MustacheStub(array( + 'cache' => self::$tempDir, + )); + + $this->assertInstanceOf('Mustache_Cache_NoopCache', $mustache->getProtectedLambdaCache()); + $this->assertNotSame($mustache->getCache(), $mustache->getProtectedLambdaCache()); + } + + /** + * @expectedException Mustache_Exception_InvalidArgumentException + */ + public function testEmptyTemplatePrefixThrowsException() + { + new Mustache_Engine(array( + 'template_class_prefix' => '', + )); + } + + /** + * @expectedException Mustache_Exception_InvalidArgumentException + * @dataProvider getBadEscapers + */ + public function testNonCallableEscapeThrowsException($escape) + { + new Mustache_Engine(array('escape' => $escape)); + } + + public function getBadEscapers() + { + return array( + array('nothing'), + array('foo', 'bar'), + ); + } + + /** + * @expectedException Mustache_Exception_RuntimeException + */ + public function testImmutablePartialsLoadersThrowException() + { + $mustache = new Mustache_Engine(array( + 'partials_loader' => new Mustache_Loader_StringLoader(), + )); + + $mustache->setPartials(array('foo' => '{{ foo }}')); + } + + public function testMissingPartialsTreatedAsEmptyString() + { + $mustache = new Mustache_Engine(array( + 'partials_loader' => new Mustache_Loader_ArrayLoader(array( + 'foo' => 'FOO', + 'baz' => 'BAZ', + )), + )); + + $this->assertEquals('FOOBAZ', $mustache->render('{{>foo}}{{>bar}}{{>baz}}', array())); + } + + public function testHelpers() + { + $foo = array($this, 'getFoo'); + $bar = 'BAR'; + $mustache = new Mustache_Engine(array('helpers' => array( + 'foo' => $foo, + 'bar' => $bar, + ))); + + $helpers = $mustache->getHelpers(); + $this->assertTrue($mustache->hasHelper('foo')); + $this->assertTrue($mustache->hasHelper('bar')); + $this->assertTrue($helpers->has('foo')); + $this->assertTrue($helpers->has('bar')); + $this->assertSame($foo, $mustache->getHelper('foo')); + $this->assertSame($bar, $mustache->getHelper('bar')); + + $mustache->removeHelper('bar'); + $this->assertFalse($mustache->hasHelper('bar')); + $mustache->addHelper('bar', $bar); + $this->assertSame($bar, $mustache->getHelper('bar')); + + $baz = array($this, 'wrapWithUnderscores'); + $this->assertFalse($mustache->hasHelper('baz')); + $this->assertFalse($helpers->has('baz')); + + $mustache->addHelper('baz', $baz); + $this->assertTrue($mustache->hasHelper('baz')); + $this->assertTrue($helpers->has('baz')); + + // ... and a functional test + $tpl = $mustache->loadTemplate('{{foo}} - {{bar}} - {{#baz}}qux{{/baz}}'); + $this->assertEquals('foo - BAR - __qux__', $tpl->render()); + $this->assertEquals('foo - BAR - __qux__', $tpl->render(array('qux' => "won't mess things up"))); + } + + public static function wrapWithUnderscores($text) + { + return '__' . $text . '__'; + } + + /** + * @expectedException Mustache_Exception_InvalidArgumentException + */ + public function testSetHelpersThrowsExceptions() + { + $mustache = new Mustache_Engine(); + $mustache->setHelpers('monkeymonkeymonkey'); + } + + /** + * @expectedException Mustache_Exception_InvalidArgumentException + */ + public function testSetLoggerThrowsExceptions() + { + $mustache = new Mustache_Engine(); + $mustache->setLogger(new StdClass()); + } + + public function testLoadPartialCascading() + { + $loader = new Mustache_Loader_ArrayLoader(array( + 'foo' => 'FOO', + )); + + $mustache = new Mustache_Engine(array('loader' => $loader)); + + $tpl = $mustache->loadTemplate('foo'); + + $this->assertSame($tpl, $mustache->loadPartial('foo')); + + $mustache->setPartials(array( + 'foo' => 'f00', + )); + + // setting partials overrides the default template loading fallback. + $this->assertNotSame($tpl, $mustache->loadPartial('foo')); + + // but it didn't overwrite the original template loader templates. + $this->assertSame($tpl, $mustache->loadTemplate('foo')); + } + + public function testPartialLoadFailLogging() + { + $name = tempnam(sys_get_temp_dir(), 'mustache-test'); + $mustache = new Mustache_Engine(array( + 'logger' => new Mustache_Logger_StreamLogger($name, Mustache_Logger::WARNING), + 'partials' => array( + 'foo' => 'FOO', + 'bar' => 'BAR', + ), + )); + + $result = $mustache->render('{{> foo }}{{> bar }}{{> baz }}', array()); + $this->assertEquals('FOOBAR', $result); + + $this->assertContains('WARNING: Partial not found: "baz"', file_get_contents($name)); + } + + public function testCacheWarningLogging() + { + list($name, $mustache) = $this->getLoggedMustache(Mustache_Logger::WARNING); + $mustache->render('{{ foo }}', array('foo' => 'FOO')); + $this->assertContains('WARNING: Template cache disabled, evaluating', file_get_contents($name)); + } + + public function testLoggingIsNotTooAnnoying() + { + list($name, $mustache) = $this->getLoggedMustache(); + $mustache->render('{{ foo }}{{> bar }}', array('foo' => 'FOO')); + $this->assertEmpty(file_get_contents($name)); + } + + public function testVerboseLoggingIsVerbose() + { + list($name, $mustache) = $this->getLoggedMustache(Mustache_Logger::DEBUG); + $mustache->render('{{ foo }}{{> bar }}', array('foo' => 'FOO')); + $log = file_get_contents($name); + $this->assertContains('DEBUG: Instantiating template: ', $log); + $this->assertContains('WARNING: Partial not found: "bar"', $log); + } + + /** + * @expectedException Mustache_Exception_InvalidArgumentException + */ + public function testUnknownPragmaThrowsException() + { + new Mustache_Engine(array( + 'pragmas' => array('UNKNOWN'), + )); + } + + public function testCompileFromMustacheSourceInstance() + { + $baseDir = realpath(dirname(__FILE__) . '/../../fixtures/templates'); + $mustache = new Mustache_Engine(array( + 'loader' => new Mustache_Loader_ProductionFilesystemLoader($baseDir), + )); + $this->assertEquals('one contents', $mustache->render('one')); + } + + private function getLoggedMustache($level = Mustache_Logger::ERROR) + { + $name = tempnam(sys_get_temp_dir(), 'mustache-test'); + $mustache = new Mustache_Engine(array( + 'logger' => new Mustache_Logger_StreamLogger($name, $level), + )); + + return array($name, $mustache); + } + + public function testCustomDelimiters() + { + $mustache = new Mustache_Engine(array( + 'delimiters' => '[[ ]]', + 'partials' => array( + 'one' => '[[> two ]]', + 'two' => '[[ a ]]', + ), + )); + + $tpl = $mustache->loadTemplate('[[# a ]][[ b ]][[/a ]]'); + $this->assertEquals('c', $tpl->render(array('a' => true, 'b' => 'c'))); + + $tpl = $mustache->loadTemplate('[[> one ]]'); + $this->assertEquals('b', $tpl->render(array('a' => 'b'))); + } +} + +class MustacheStub extends Mustache_Engine +{ + public $source; + public $template; + + public function loadTemplate($source) + { + $this->source = $source; + + return $this->template; + } + + public function getProtectedLambdaCache() + { + return $this->getLambdaCache(); + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Exception/SyntaxExceptionTest.php b/vendor/mustache/mustache/test/Mustache/Test/Exception/SyntaxExceptionTest.php new file mode 100644 index 00000000..074dafcd --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/Exception/SyntaxExceptionTest.php @@ -0,0 +1,39 @@ + 'this')); + $this->assertTrue($e instanceof LogicException); + $this->assertTrue($e instanceof Mustache_Exception); + } + + public function testGetToken() + { + $token = array(Mustache_Tokenizer::TYPE => 'whatever'); + $e = new Mustache_Exception_SyntaxException('ignore this', $token); + $this->assertEquals($token, $e->getToken()); + } + + public function testPrevious() + { + if (version_compare(PHP_VERSION, '5.3.0', '<')) { + $this->markTestSkipped('Exception chaining requires at least PHP 5.3'); + } + + $previous = new Exception(); + $e = new Mustache_Exception_SyntaxException('foo', array(), $previous); + + $this->assertSame($previous, $e->getPrevious()); + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Exception/UnknownFilterExceptionTest.php b/vendor/mustache/mustache/test/Mustache/Test/Exception/UnknownFilterExceptionTest.php new file mode 100644 index 00000000..6dbe25e3 --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/Exception/UnknownFilterExceptionTest.php @@ -0,0 +1,44 @@ +assertTrue($e instanceof UnexpectedValueException); + $this->assertTrue($e instanceof Mustache_Exception); + } + + public function testMessage() + { + $e = new Mustache_Exception_UnknownFilterException('sausage'); + $this->assertEquals('Unknown filter: sausage', $e->getMessage()); + } + + public function testGetFilterName() + { + $e = new Mustache_Exception_UnknownFilterException('eggs'); + $this->assertEquals('eggs', $e->getFilterName()); + } + + public function testPrevious() + { + if (version_compare(PHP_VERSION, '5.3.0', '<')) { + $this->markTestSkipped('Exception chaining requires at least PHP 5.3'); + } + + $previous = new Exception(); + $e = new Mustache_Exception_UnknownFilterException('foo', $previous); + + $this->assertSame($previous, $e->getPrevious()); + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Exception/UnknownHelperExceptionTest.php b/vendor/mustache/mustache/test/Mustache/Test/Exception/UnknownHelperExceptionTest.php new file mode 100644 index 00000000..5b1ccbb6 --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/Exception/UnknownHelperExceptionTest.php @@ -0,0 +1,43 @@ +assertTrue($e instanceof InvalidArgumentException); + $this->assertTrue($e instanceof Mustache_Exception); + } + + public function testMessage() + { + $e = new Mustache_Exception_UnknownHelperException('beta'); + $this->assertEquals('Unknown helper: beta', $e->getMessage()); + } + + public function testGetHelperName() + { + $e = new Mustache_Exception_UnknownHelperException('gamma'); + $this->assertEquals('gamma', $e->getHelperName()); + } + + public function testPrevious() + { + if (version_compare(PHP_VERSION, '5.3.0', '<')) { + $this->markTestSkipped('Exception chaining requires at least PHP 5.3'); + } + + $previous = new Exception(); + $e = new Mustache_Exception_UnknownHelperException('foo', $previous); + $this->assertSame($previous, $e->getPrevious()); + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Exception/UnknownTemplateExceptionTest.php b/vendor/mustache/mustache/test/Mustache/Test/Exception/UnknownTemplateExceptionTest.php new file mode 100644 index 00000000..b993bfa8 --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/Exception/UnknownTemplateExceptionTest.php @@ -0,0 +1,43 @@ +assertTrue($e instanceof InvalidArgumentException); + $this->assertTrue($e instanceof Mustache_Exception); + } + + public function testMessage() + { + $e = new Mustache_Exception_UnknownTemplateException('luigi'); + $this->assertEquals('Unknown template: luigi', $e->getMessage()); + } + + public function testGetTemplateName() + { + $e = new Mustache_Exception_UnknownTemplateException('yoshi'); + $this->assertEquals('yoshi', $e->getTemplateName()); + } + + public function testPrevious() + { + if (version_compare(PHP_VERSION, '5.3.0', '<')) { + $this->markTestSkipped('Exception chaining requires at least PHP 5.3'); + } + + $previous = new Exception(); + $e = new Mustache_Exception_UnknownTemplateException('foo', $previous); + $this->assertSame($previous, $e->getPrevious()); + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/ClosureQuirksTest.php b/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/ClosureQuirksTest.php new file mode 100644 index 00000000..cc575a9d --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/ClosureQuirksTest.php @@ -0,0 +1,32 @@ +mustache = new Mustache_Engine(); + } + + public function testClosuresDontLikeItWhenYouTouchTheirProperties() + { + $tpl = $this->mustache->loadTemplate('{{ foo.bar }}'); + $this->assertEquals('', $tpl->render(array('foo' => function () { + return 'FOO'; + }))); + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/EngineTest.php b/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/EngineTest.php new file mode 100644 index 00000000..406473eb --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/EngineTest.php @@ -0,0 +1,50 @@ + $pragmas, + 'helpers' => $helpers, + )); + + $this->assertEquals($expect, $mustache->render($tpl, $data)); + } + + public function pragmaData() + { + $helpers = array( + 'longdate' => function (\DateTime $value) { + return $value->format('Y-m-d h:m:s'); + }, + ); + + $data = array( + 'date' => new DateTime('1/1/2000', new DateTimeZone('UTC')), + ); + + $tpl = '{{ date | longdate }}'; + + return array( + array(array(Mustache_Engine::PRAGMA_FILTERS), $helpers, $data, $tpl, '2000-01-01 12:01:00'), + array(array(), $helpers, $data, $tpl, ''), + ); + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/FiltersTest.php b/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/FiltersTest.php new file mode 100644 index 00000000..16dec608 --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/FiltersTest.php @@ -0,0 +1,187 @@ +mustache = new Mustache_Engine(); + } + + /** + * @dataProvider singleFilterData + */ + public function testSingleFilter($tpl, $helpers, $data, $expect) + { + $this->mustache->setHelpers($helpers); + $this->assertEquals($expect, $this->mustache->render($tpl, $data)); + } + + public function singleFilterData() + { + $helpers = array( + 'longdate' => function (\DateTime $value) { + return $value->format('Y-m-d h:m:s'); + }, + 'echo' => function ($value) { + return array($value, $value, $value); + }, + ); + + return array( + array( + '{{% FILTERS }}{{ date | longdate }}', + $helpers, + (object) array('date' => new DateTime('1/1/2000', new DateTimeZone('UTC'))), + '2000-01-01 12:01:00', + ), + + array( + '{{% FILTERS }}{{# word | echo }}{{ . }}!{{/ word | echo }}', + $helpers, + array('word' => 'bacon'), + 'bacon!bacon!bacon!', + ), + ); + } + + public function testChainedFilters() + { + $tpl = $this->mustache->loadTemplate('{{% FILTERS }}{{ date | longdate | withbrackets }}'); + + $this->mustache->addHelper('longdate', function (\DateTime $value) { + return $value->format('Y-m-d h:m:s'); + }); + + $this->mustache->addHelper('withbrackets', function ($value) { + return sprintf('[[%s]]', $value); + }); + + $foo = new \StdClass(); + $foo->date = new DateTime('1/1/2000', new DateTimeZone('UTC')); + + $this->assertEquals('[[2000-01-01 12:01:00]]', $tpl->render($foo)); + } + + const CHAINED_SECTION_FILTERS_TPL = <<<'EOS' +{{% FILTERS }} +{{# word | echo | with_index }} +{{ key }}: {{ value }} +{{/ word | echo | with_index }} +EOS; + + public function testChainedSectionFilters() + { + $tpl = $this->mustache->loadTemplate(self::CHAINED_SECTION_FILTERS_TPL); + + $this->mustache->addHelper('echo', function ($value) { + return array($value, $value, $value); + }); + + $this->mustache->addHelper('with_index', function ($value) { + return array_map(function ($k, $v) { + return array( + 'key' => $k, + 'value' => $v, + ); + }, array_keys($value), $value); + }); + + $this->assertEquals("0: bacon\n1: bacon\n2: bacon\n", $tpl->render(array('word' => 'bacon'))); + } + + /** + * @dataProvider interpolateFirstData + */ + public function testInterpolateFirst($tpl, $data, $expect) + { + $this->assertEquals($expect, $this->mustache->render($tpl, $data)); + } + + public function interpolateFirstData() + { + $data = array( + 'foo' => 'FOO', + 'bar' => function ($value) { + return ($value === 'FOO') ? 'win!' : 'fail :('; + }, + ); + + return array( + array('{{% FILTERS }}{{ foo | bar }}', $data, 'win!'), + array('{{% FILTERS }}{{# foo | bar }}{{ . }}{{/ foo | bar }}', $data, 'win!'), + ); + } + + /** + * @expectedException Mustache_Exception_UnknownFilterException + * @dataProvider brokenPipeData + */ + public function testThrowsExceptionForBrokenPipes($tpl, $data) + { + $this->mustache->render($tpl, $data); + } + + public function brokenPipeData() + { + return array( + array('{{% FILTERS }}{{ foo | bar }}', array()), + array('{{% FILTERS }}{{ foo | bar }}', array('foo' => 'FOO')), + array('{{% FILTERS }}{{ foo | bar }}', array('foo' => 'FOO', 'bar' => 'BAR')), + array('{{% FILTERS }}{{ foo | bar }}', array('foo' => 'FOO', 'bar' => array(1, 2))), + array('{{% FILTERS }}{{ foo | bar | baz }}', array('foo' => 'FOO', 'bar' => function () { + return 'BAR'; + })), + array('{{% FILTERS }}{{ foo | bar | baz }}', array('foo' => 'FOO', 'baz' => function () { + return 'BAZ'; + })), + array('{{% FILTERS }}{{ foo | bar | baz }}', array('bar' => function () { + return 'BAR'; + })), + array('{{% FILTERS }}{{ foo | bar | baz }}', array('baz' => function () { + return 'BAZ'; + })), + array('{{% FILTERS }}{{ foo | bar.baz }}', array('foo' => 'FOO', 'bar' => function () { + return 'BAR'; + }, 'baz' => function () { + return 'BAZ'; + })), + + array('{{% FILTERS }}{{# foo | bar }}{{ . }}{{/ foo | bar }}', array()), + array('{{% FILTERS }}{{# foo | bar }}{{ . }}{{/ foo | bar }}', array('foo' => 'FOO')), + array('{{% FILTERS }}{{# foo | bar }}{{ . }}{{/ foo | bar }}', array('foo' => 'FOO', 'bar' => 'BAR')), + array('{{% FILTERS }}{{# foo | bar }}{{ . }}{{/ foo | bar }}', array('foo' => 'FOO', 'bar' => array(1, 2))), + array('{{% FILTERS }}{{# foo | bar | baz }}{{ . }}{{/ foo | bar | baz }}', array('foo' => 'FOO', 'bar' => function () { + return 'BAR'; + })), + array('{{% FILTERS }}{{# foo | bar | baz }}{{ . }}{{/ foo | bar | baz }}', array('foo' => 'FOO', 'baz' => function () { + return 'BAZ'; + })), + array('{{% FILTERS }}{{# foo | bar | baz }}{{ . }}{{/ foo | bar | baz }}', array('bar' => function () { + return 'BAR'; + })), + array('{{% FILTERS }}{{# foo | bar | baz }}{{ . }}{{/ foo | bar | baz }}', array('baz' => function () { + return 'BAZ'; + })), + array('{{% FILTERS }}{{# foo | bar.baz }}{{ . }}{{/ foo | bar.baz }}', array('foo' => 'FOO', 'bar' => function () { + return 'BAR'; + }, 'baz' => function () { + return 'BAZ'; + })), + ); + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/HigherOrderSectionsTest.php b/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/HigherOrderSectionsTest.php new file mode 100644 index 00000000..eb051504 --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/HigherOrderSectionsTest.php @@ -0,0 +1,77 @@ +mustache = new Mustache_Engine(); + } + + public function testAnonymousFunctionSectionCallback() + { + $tpl = $this->mustache->loadTemplate('{{#wrapper}}{{name}}{{/wrapper}}'); + + $foo = new Mustache_Test_FiveThree_Functional_Foo(); + $foo->name = 'Mario'; + $foo->wrapper = function ($text) { + return sprintf('
%s
', $text); + }; + + $this->assertEquals(sprintf('
%s
', $foo->name), $tpl->render($foo)); + } + + public function testSectionCallback() + { + $one = $this->mustache->loadTemplate('{{name}}'); + $two = $this->mustache->loadTemplate('{{#wrap}}{{name}}{{/wrap}}'); + + $foo = new Mustache_Test_FiveThree_Functional_Foo(); + $foo->name = 'Luigi'; + + $this->assertEquals($foo->name, $one->render($foo)); + $this->assertEquals(sprintf('%s', $foo->name), $two->render($foo)); + } + + public function testViewArrayAnonymousSectionCallback() + { + $tpl = $this->mustache->loadTemplate('{{#wrap}}{{name}}{{/wrap}}'); + + $data = array( + 'name' => 'Bob', + 'wrap' => function ($text) { + return sprintf('[[%s]]', $text); + }, + ); + + $this->assertEquals(sprintf('[[%s]]', $data['name']), $tpl->render($data)); + } +} + +class Mustache_Test_FiveThree_Functional_Foo +{ + public $name = 'Justin'; + public $lorem = 'Lorem ipsum dolor sit amet,'; + public $wrap; + + public function __construct() + { + $this->wrap = function ($text) { + return sprintf('%s', $text); + }; + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/LambdaHelperTest.php b/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/LambdaHelperTest.php new file mode 100644 index 00000000..6fc5d400 --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/LambdaHelperTest.php @@ -0,0 +1,67 @@ +mustache = new Mustache_Engine(); + } + + public function testSectionLambdaHelper() + { + $one = $this->mustache->loadTemplate('{{name}}'); + $two = $this->mustache->loadTemplate('{{#lambda}}{{name}}{{/lambda}}'); + + $foo = new StdClass(); + $foo->name = 'Mario'; + $foo->lambda = function ($text, $mustache) { + return strtoupper($mustache->render($text)); + }; + + $this->assertEquals('Mario', $one->render($foo)); + $this->assertEquals('MARIO', $two->render($foo)); + } + + public function testSectionLambdaHelperRespectsDelimiterChanges() + { + $tpl = $this->mustache->loadTemplate("{{=<% %>=}}\n<%# bang %><% value %><%/ bang %>"); + + $data = new StdClass(); + $data->value = 'hello world'; + $data->bang = function ($text, $mustache) { + return $mustache->render($text) . '!'; + }; + + $this->assertEquals('hello world!', $tpl->render($data)); + } + + public function testLambdaHelperIsInvokable() + { + $one = $this->mustache->loadTemplate('{{name}}'); + $two = $this->mustache->loadTemplate('{{#lambda}}{{name}}{{/lambda}}'); + + $foo = new StdClass(); + $foo->name = 'Mario'; + $foo->lambda = function ($text, $render) { + return strtoupper($render($text)); + }; + + $this->assertEquals('Mario', $one->render($foo)); + $this->assertEquals('MARIO', $two->render($foo)); + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/MustacheSpecTest.php b/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/MustacheSpecTest.php new file mode 100644 index 00000000..af3f982b --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/MustacheSpecTest.php @@ -0,0 +1,68 @@ +markTestSkipped('Mustache spec submodule not initialized: run "git submodule update --init"'); + } + } + + /** + * @group lambdas + * @dataProvider loadLambdasSpec + */ + public function testLambdasSpec($desc, $source, $partials, $data, $expected) + { + $template = self::loadTemplate($source, $partials); + $this->assertEquals($expected, $template($this->prepareLambdasSpec($data)), $desc); + } + + public function loadLambdasSpec() + { + return $this->loadSpec('~lambdas'); + } + + /** + * Extract and lambdafy any 'lambda' values found in the $data array. + */ + private function prepareLambdasSpec($data) + { + foreach ($data as $key => $val) { + if ($key === 'lambda') { + if (!isset($val['php'])) { + $this->markTestSkipped(sprintf('PHP lambda test not implemented for this test.')); + } + + $func = $val['php']; + $data[$key] = function ($text = null) use ($func) { + return eval($func); + }; + } elseif (is_array($val)) { + $data[$key] = $this->prepareLambdasSpec($val); + } + } + + return $data; + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/PartialLambdaIndentTest.php b/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/PartialLambdaIndentTest.php new file mode 100644 index 00000000..1f9af7ca --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/PartialLambdaIndentTest.php @@ -0,0 +1,94 @@ + + {{> input }} + + +EOS; + $partial = <<<'EOS' + + +EOS; + + $expected = <<<'EOS' +
+ +
+ +EOS; + + $m = new Mustache_Engine(array( + 'partials' => array('input' => $partial), + )); + + $tpl = $m->loadTemplate($src); + + $data = new Mustache_Test_FiveThree_Functional_ClassWithLambda(); + $this->assertEquals($expected, $tpl->render($data)); + } + + public function testLambdaInterpolationsInsidePartialsAreIndentedProperly() + { + $src = <<<'EOS' +
+ {{> input }} +
+ +EOS; + $partial = <<<'EOS' + + +EOS; + + $expected = <<<'EOS' +
+ +
+ +EOS; + + $m = new Mustache_Engine(array( + 'partials' => array('input' => $partial), + )); + + $tpl = $m->loadTemplate($src); + + $data = new Mustache_Test_FiveThree_Functional_ClassWithLambda(); + $this->assertEquals($expected, $tpl->render($data)); + } +} + +class Mustache_Test_FiveThree_Functional_ClassWithLambda +{ + public function _t() + { + return function ($val) { + return strtoupper($val); + }; + } + + public function placeholder() + { + return function () { + return 'Enter your name'; + }; + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/StrictCallablesTest.php b/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/StrictCallablesTest.php new file mode 100644 index 00000000..2c01169e --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/StrictCallablesTest.php @@ -0,0 +1,135 @@ + $strict)); + $tpl = $mustache->loadTemplate('{{# section }}{{ name }}{{/ section }}'); + + $data = new StdClass(); + $data->name = $name; + $data->section = $section; + + $this->assertEquals($expected, $tpl->render($data)); + } + + public function callables() + { + $lambda = function ($tpl, $mustache) { + return strtoupper($mustache->render($tpl)); + }; + + return array( + // Interpolation lambdas + array( + false, + array($this, 'instanceName'), + $lambda, + 'YOSHI', + ), + array( + false, + array(__CLASS__, 'staticName'), + $lambda, + 'YOSHI', + ), + array( + false, + function () { + return 'Yoshi'; + }, + $lambda, + 'YOSHI', + ), + + // Section lambdas + array( + false, + 'Yoshi', + array($this, 'instanceCallable'), + 'YOSHI', + ), + array( + false, + 'Yoshi', + array(__CLASS__, 'staticCallable'), + 'YOSHI', + ), + array( + false, + 'Yoshi', + $lambda, + 'YOSHI', + ), + + // Strict interpolation lambdas + array( + true, + function () { + return 'Yoshi'; + }, + $lambda, + 'YOSHI', + ), + + // Strict section lambdas + array( + true, + 'Yoshi', + array($this, 'instanceCallable'), + 'YoshiYoshi', + ), + array( + true, + 'Yoshi', + array(__CLASS__, 'staticCallable'), + 'YoshiYoshi', + ), + array( + true, + 'Yoshi', + function ($tpl, $mustache) { + return strtoupper($mustache->render($tpl)); + }, + 'YOSHI', + ), + ); + } + + public function instanceCallable($tpl, $mustache) + { + return strtoupper($mustache->render($tpl)); + } + + public static function staticCallable($tpl, $mustache) + { + return strtoupper($mustache->render($tpl)); + } + + public function instanceName() + { + return 'Yoshi'; + } + + public static function staticName() + { + return 'Yoshi'; + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Functional/CallTest.php b/vendor/mustache/mustache/test/Mustache/Test/Functional/CallTest.php new file mode 100644 index 00000000..681ec1bc --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/Functional/CallTest.php @@ -0,0 +1,40 @@ +loadTemplate('{{# foo }}{{ label }}: {{ name }}{{/ foo }}'); + + $foo = new Mustache_Test_Functional_ClassWithCall(); + $foo->name = 'Bob'; + + $data = array('label' => 'name', 'foo' => $foo); + + $this->assertEquals('name: Bob', $tpl->render($data)); + } +} + +class Mustache_Test_Functional_ClassWithCall +{ + public $name; + + public function __call($method, $args) + { + return 'unknown value'; + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Functional/ExamplesTest.php b/vendor/mustache/mustache/test/Mustache/Test/Functional/ExamplesTest.php new file mode 100644 index 00000000..ac883ea4 --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/Functional/ExamplesTest.php @@ -0,0 +1,142 @@ + $partials, + )); + $this->assertEquals($expected, $mustache->loadTemplate($source)->render($context)); + } + + /** + * Data provider for testExamples method. + * + * Loads examples from the test fixtures directory. + * + * This examples directory should contain any number of subdirectories, each of which contains + * three files: one Mustache class (.php), one Mustache template (.mustache), and one output file + * (.txt). Optionally, the directory may contain a folder full of partials. + * + * @return array + */ + public function getExamples() + { + $path = realpath(dirname(__FILE__) . '/../../../fixtures/examples'); + $examples = array(); + + $handle = opendir($path); + while (($file = readdir($handle)) !== false) { + if ($file === '.' || $file === '..') { + continue; + } + + $fullpath = $path . '/' . $file; + if (is_dir($fullpath)) { + $examples[$file] = $this->loadExample($fullpath); + } + } + closedir($handle); + + return $examples; + } + + /** + * Helper method to load an example given the full path. + * + * @param string $path + * + * @return array arguments for testExamples + */ + private function loadExample($path) + { + $context = null; + $source = null; + $partials = array(); + $expected = null; + + $handle = opendir($path); + while (($file = readdir($handle)) !== false) { + $fullpath = $path . '/' . $file; + $info = pathinfo($fullpath); + + if (is_dir($fullpath) && $info['basename'] === 'partials') { + // load partials + $partials = $this->loadPartials($fullpath); + } elseif (is_file($fullpath)) { + // load other files + switch ($info['extension']) { + case 'php': + require_once $fullpath; + $className = $info['filename']; + $context = new $className(); + break; + + case 'mustache': + $source = file_get_contents($fullpath); + break; + + case 'txt': + $expected = file_get_contents($fullpath); + break; + } + } + } + closedir($handle); + + return array($context, $source, $partials, $expected); + } + + /** + * Helper method to load partials given an example directory. + * + * @param string $path + * + * @return array $partials + */ + private function loadPartials($path) + { + $partials = array(); + + $handle = opendir($path); + while (($file = readdir($handle)) !== false) { + if ($file === '.' || $file === '..') { + continue; + } + + $fullpath = $path . '/' . $file; + $info = pathinfo($fullpath); + + if ($info['extension'] === 'mustache') { + $partials[$info['filename']] = file_get_contents($fullpath); + } + } + closedir($handle); + + return $partials; + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Functional/HigherOrderSectionsTest.php b/vendor/mustache/mustache/test/Mustache/Test/Functional/HigherOrderSectionsTest.php new file mode 100644 index 00000000..14774cd2 --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/Functional/HigherOrderSectionsTest.php @@ -0,0 +1,177 @@ +mustache = new Mustache_Engine(); + } + + /** + * @dataProvider sectionCallbackData + */ + public function testSectionCallback($data, $tpl, $expect) + { + $this->assertEquals($expect, $this->mustache->render($tpl, $data)); + } + + public function sectionCallbackData() + { + $foo = new Mustache_Test_Functional_Foo(); + $foo->doublewrap = array($foo, 'wrapWithBoth'); + + $bar = new Mustache_Test_Functional_Foo(); + $bar->trimmer = array(get_class($bar), 'staticTrim'); + + return array( + array($foo, '{{#doublewrap}}{{name}}{{/doublewrap}}', sprintf('%s', $foo->name)), + array($bar, '{{#trimmer}} {{name}} {{/trimmer}}', $bar->name), + ); + } + + public function testViewArraySectionCallback() + { + $tpl = $this->mustache->loadTemplate('{{#trim}} {{name}} {{/trim}}'); + + $foo = new Mustache_Test_Functional_Foo(); + + $data = array( + 'name' => 'Bob', + 'trim' => array(get_class($foo), 'staticTrim'), + ); + + $this->assertEquals($data['name'], $tpl->render($data)); + } + + public function testMonsters() + { + $tpl = $this->mustache->loadTemplate('{{#title}}{{title}} {{/title}}{{name}}'); + + $frank = new Mustache_Test_Functional_Monster(); + $frank->title = 'Dr.'; + $frank->name = 'Frankenstein'; + $this->assertEquals('Dr. Frankenstein', $tpl->render($frank)); + + $dracula = new Mustache_Test_Functional_Monster(); + $dracula->title = 'Count'; + $dracula->name = 'Dracula'; + $this->assertEquals('Count Dracula', $tpl->render($dracula)); + } + + public function testPassthroughOptimization() + { + $mustache = $this->getMock('Mustache_Engine', array('loadLambda')); + $mustache->expects($this->never()) + ->method('loadLambda'); + + $tpl = $mustache->loadTemplate('{{#wrap}}NAME{{/wrap}}'); + + $foo = new Mustache_Test_Functional_Foo(); + $foo->wrap = array($foo, 'wrapWithEm'); + + $this->assertEquals('NAME', $tpl->render($foo)); + } + + public function testWithoutPassthroughOptimization() + { + $mustache = $this->getMock('Mustache_Engine', array('loadLambda')); + $mustache->expects($this->once()) + ->method('loadLambda') + ->will($this->returnValue($mustache->loadTemplate('{{ name }}'))); + + $tpl = $mustache->loadTemplate('{{#wrap}}{{name}}{{/wrap}}'); + + $foo = new Mustache_Test_Functional_Foo(); + $foo->wrap = array($foo, 'wrapWithEm'); + + $this->assertEquals('' . $foo->name . '', $tpl->render($foo)); + } + + /** + * @dataProvider cacheLambdaTemplatesData + */ + public function testCacheLambdaTemplatesOptionWorks($dirName, $tplPrefix, $enable, $expect) + { + $cacheDir = $this->setUpCacheDir($dirName); + $mustache = new Mustache_Engine(array( + 'template_class_prefix' => $tplPrefix, + 'cache' => $cacheDir, + 'cache_lambda_templates' => $enable, + )); + + $tpl = $mustache->loadTemplate('{{#wrap}}{{name}}{{/wrap}}'); + $foo = new Mustache_Test_Functional_Foo(); + $foo->wrap = array($foo, 'wrapWithEm'); + $this->assertEquals('' . $foo->name . '', $tpl->render($foo)); + $this->assertCount($expect, glob($cacheDir . '/*.php')); + } + + public function cacheLambdaTemplatesData() + { + return array( + array('test_enabling_lambda_cache', '_TestEnablingLambdaCache_', true, 2), + array('test_disabling_lambda_cache', '_TestDisablingLambdaCache_', false, 1), + ); + } + + protected function setUpCacheDir($name) + { + $cacheDir = self::$tempDir . '/' . $name; + if (file_exists($cacheDir)) { + self::rmdir($cacheDir); + } + mkdir($cacheDir, 0777, true); + + return $cacheDir; + } +} + +class Mustache_Test_Functional_Foo +{ + public $name = 'Justin'; + public $lorem = 'Lorem ipsum dolor sit amet,'; + + public function wrapWithEm($text) + { + return sprintf('%s', $text); + } + + /** + * @param string $text + */ + public function wrapWithStrong($text) + { + return sprintf('%s', $text); + } + + public function wrapWithBoth($text) + { + return self::wrapWithStrong(self::wrapWithEm($text)); + } + + public static function staticTrim($text) + { + return trim($text); + } +} + +class Mustache_Test_Functional_Monster +{ + public $title; + public $name; +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Functional/InheritanceTest.php b/vendor/mustache/mustache/test/Mustache/Test/Functional/InheritanceTest.php new file mode 100644 index 00000000..62437041 --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/Functional/InheritanceTest.php @@ -0,0 +1,543 @@ +mustache = new Mustache_Engine(array( + 'pragmas' => array(Mustache_Engine::PRAGMA_BLOCKS), + )); + } + + public function getIllegalInheritanceExamples() + { + return array( + array( + array( + 'foo' => '{{$baz}}default content{{/baz}}', + ), + array( + 'bar' => 'set by user', + ), + '{{< foo }}{{# bar }}{{$ baz }}{{/ baz }}{{/ bar }}{{/ foo }}', + ), + array( + array( + 'foo' => '{{$baz}}default content{{/baz}}', + ), + array( + ), + '{{ '{{$baz}}default content{{/baz}}', + 'qux' => 'I am a partial', + ), + array( + ), + '{{qux}}{{$baz}}set by template{{/baz}}{{/foo}}', + ), + array( + array( + 'foo' => '{{$baz}}default content{{/baz}}', + ), + array(), + '{{=}}<%={{ }}=%>{{/foo}}', + ), + ); + } + + public function getLegalInheritanceExamples() + { + return array( + array( + array( + 'foo' => '{{$baz}}default content{{/baz}}', + ), + array( + 'bar' => 'set by user', + ), + '{{ '{{$baz}}default content{{/baz}}', + ), + array( + ), + '{{ '{{$baz}}defualt content{{/baz}}', + ), + array(), + '{{ '{{$a}}FAIL!{{/a}}', + 'bar' => 'WIN!!', + ), + array(), + '{{mustache->loadTemplate('{{$title}}Default title{{/title}}'); + + $data = array(); + + $this->assertEquals('Default title', $tpl->render($data)); + } + + public function testDefaultContentRendersVariables() + { + $tpl = $this->mustache->loadTemplate('{{$foo}}default {{bar}} content{{/foo}}'); + + $data = array( + 'bar' => 'baz', + ); + + $this->assertEquals('default baz content', $tpl->render($data)); + } + + public function testDefaultContentRendersTripleMustacheVariables() + { + $tpl = $this->mustache->loadTemplate('{{$foo}}default {{{bar}}} content{{/foo}}'); + + $data = array( + 'bar' => '', + ); + + $this->assertEquals('default content', $tpl->render($data)); + } + + public function testDefaultContentRendersSections() + { + $tpl = $this->mustache->loadTemplate( + '{{$foo}}default {{#bar}}{{baz}}{{/bar}} content{{/foo}}' + ); + + $data = array( + 'bar' => array('baz' => 'qux'), + ); + + $this->assertEquals('default qux content', $tpl->render($data)); + } + + public function testDefaultContentRendersNegativeSections() + { + $tpl = $this->mustache->loadTemplate( + '{{$foo}}default {{^bar}}{{baz}}{{/bar}} content{{/foo}}' + ); + + $data = array( + 'foo' => array('bar' => 'qux'), + 'baz' => 'three', + ); + + $this->assertEquals('default three content', $tpl->render($data)); + } + + public function testMustacheInjectionInDefaultContent() + { + $tpl = $this->mustache->loadTemplate( + '{{$foo}}default {{#bar}}{{baz}}{{/bar}} content{{/foo}}' + ); + + $data = array( + 'bar' => array('baz' => '{{qux}}'), + ); + + $this->assertEquals('default {{qux}} content', $tpl->render($data)); + } + + public function testDefaultContentRenderedInsideIncludedTemplates() + { + $partials = array( + 'include' => '{{$foo}}default content{{/foo}}', + ); + + $this->mustache->setPartials($partials); + + $tpl = $this->mustache->loadTemplate( + '{{assertEquals('default content', $tpl->render($data)); + } + + public function testOverriddenContent() + { + $partials = array( + 'super' => '...{{$title}}Default title{{/title}}...', + ); + + $this->mustache->setPartials($partials); + + $tpl = $this->mustache->loadTemplate( + '{{assertEquals('...sub template title...', $tpl->render($data)); + } + + public function testOverriddenPartial() + { + $partials = array( + 'partial' => '|{{$stuff}}...{{/stuff}}{{$default}} default{{/default}}|', + ); + + $this->mustache->setPartials($partials); + + $tpl = $this->mustache->loadTemplate( + 'test {{assertEquals('test |override1 default| |override2 default|', $tpl->render($data)); + } + + public function testBlocksDoNotLeakBetweenPartials() + { + $partials = array( + 'partial' => '|{{$a}}A{{/a}} {{$b}}B{{/b}}|', + ); + + $this->mustache->setPartials($partials); + + $tpl = $this->mustache->loadTemplate( + 'test {{assertEquals('test |C B| |A D|', $tpl->render($data)); + } + + public function testDataDoesNotOverrideBlock() + { + $partials = array( + 'include' => '{{$var}}var in include{{/var}}', + ); + + $this->mustache->setPartials($partials); + + $tpl = $this->mustache->loadTemplate( + '{{ 'var in data', + ); + + $this->assertEquals('var in template', $tpl->render($data)); + } + + public function testDataDoesNotOverrideDefaultBlockValue() + { + $partials = array( + 'include' => '{{$var}}var in include{{/var}}', + ); + + $this->mustache->setPartials($partials); + + $tpl = $this->mustache->loadTemplate( + '{{ 'var in data', + ); + + $this->assertEquals('var in include', $tpl->render($data)); + } + + public function testOverridePartialWithNewlines() + { + $partials = array( + 'partial' => '{{$ballmer}}peaking{{/ballmer}}', + ); + + $this->mustache->setPartials($partials); + + $tpl = $this->mustache->loadTemplate( + "{{assertEquals("peaked\n\n:(\n", $tpl->render($data)); + } + + public function testInheritIndentationWhenOverridingAPartial() + { + $partials = array( + 'partial' => 'stop: + {{$nineties}}collaborate and listen{{/nineties}}', + ); + + $this->mustache->setPartials($partials); + + $tpl = $this->mustache->loadTemplate( + '{{assertEquals( + 'stop: + hammer time', + $tpl->render($data) + ); + } + + public function testInheritSpacingWhenOverridingAPartial() + { + $partials = array( + 'parent' => 'collaborate_and{{$id}}{{/id}}', + 'child' => '{{mustache->setPartials($partials); + + $tpl = $this->mustache->loadTemplate( + 'stop: + {{>child}}' + ); + + $data = array(); + + $this->assertEquals( + 'stop: + collaborate_and_listen', + $tpl->render($data) + ); + } + + public function testOverrideOneSubstitutionButNotTheOther() + { + $partials = array( + 'partial' => '{{$stuff}}default one{{/stuff}}, {{$stuff2}}default two{{/stuff2}}', + ); + + $this->mustache->setPartials($partials); + + $tpl = $this->mustache->loadTemplate( + '{{assertEquals('default one, override two', $tpl->render($data)); + } + + public function testSuperTemplatesWithNoParameters() + { + $partials = array( + 'include' => '{{$foo}}default content{{/foo}}', + ); + + $this->mustache->setPartials($partials); + + $tpl = $this->mustache->loadTemplate( + '{{>include}}|{{assertEquals('default content|default content', $tpl->render($data)); + } + + public function testRecursionInInheritedTemplates() + { + $partials = array( + 'include' => '{{$foo}}default content{{/foo}} {{$bar}}{{ '{{$foo}}include2 default content{{/foo}} {{mustache->setPartials($partials); + + $tpl = $this->mustache->loadTemplate( + '{{assertEquals('override override override don\'t recurse', $tpl->render($data)); + } + + public function testTopLevelSubstitutionsTakePrecedenceInMultilevelInheritance() + { + $partials = array( + 'parent' => '{{ '{{ '{{$a}}g{{/a}}', + ); + + $this->mustache->setPartials($partials); + + $tpl = $this->mustache->loadTemplate( + '{{assertEquals('c', $tpl->render($data)); + } + + public function testMultiLevelInheritanceNoSubChild() + { + $partials = array( + 'parent' => '{{ '{{ '{{$a}}g{{/a}}', + ); + + $this->mustache->setPartials($partials); + + $tpl = $this->mustache->loadTemplate( + '{{assertEquals('p', $tpl->render($data)); + } + + public function testIgnoreTextInsideSuperTemplatesButParseArgs() + { + $partials = array( + 'include' => '{{$foo}}default content{{/foo}}', + ); + + $this->mustache->setPartials($partials); + + $tpl = $this->mustache->loadTemplate( + '{{assertEquals('hmm', $tpl->render($data)); + } + + public function testIgnoreTextInsideSuperTemplates() + { + $partials = array( + 'include' => '{{$foo}}default content{{/foo}}', + ); + + $this->mustache->setPartials($partials); + + $tpl = $this->mustache->loadTemplate( + '{{assertEquals('default content', $tpl->render($data)); + } + + public function testInheritanceWithLazyEvaluation() + { + $partials = array( + 'parent' => '{{#items}}{{$value}}ignored{{/value}}{{/items}}', + ); + + $this->mustache->setPartials($partials); + + $tpl = $this->mustache->loadTemplate( + '{{{{/value}}{{/parent}}' + ); + + $data = array('items' => array(1, 2, 3)); + + $this->assertEquals('<1><2><3>', $tpl->render($data)); + } + + public function testInheritanceWithLazyEvaluationWhitespaceIgnored() + { + $partials = array( + 'parent' => '{{#items}}{{$value}}\n\nignored\n\n{{/value}}{{/items}}', + ); + + $this->mustache->setPartials($partials); + + $tpl = $this->mustache->loadTemplate( + '{{{{/value}}\n\n{{/parent}}' + ); + + $data = array('items' => array(1, 2, 3)); + + $this->assertEquals('<1><2><3>', $tpl->render($data)); + } + + public function testInheritanceWithLazyEvaluationAndSections() + { + $partials = array( + 'parent' => '{{#items}}{{$value}}\n\nignored {{.}} {{#more}} there is more {{/more}}\n\n{{/value}}{{/items}}', + ); + + $this->mustache->setPartials($partials); + + $tpl = $this->mustache->loadTemplate( + '{{{{#more}} there is less {{/more}}{{/value}}\n\n{{/parent}}' + ); + + $data = array('items' => array(1, 2, 3), 'more' => 'stuff'); + + $this->assertEquals('<1> there is less <2> there is less <3> there is less ', $tpl->render($data)); + } + + /** + * @dataProvider getIllegalInheritanceExamples + * @expectedException Mustache_Exception_SyntaxException + * @expectedExceptionMessage Illegal content in < parent tag + */ + public function testIllegalInheritanceExamples($partials, $data, $template) + { + $this->mustache->setPartials($partials); + $tpl = $this->mustache->loadTemplate($template); + $tpl->render($data); + } + + /** + * @dataProvider getLegalInheritanceExamples + */ + public function testLegalInheritanceExamples($partials, $data, $template, $expect) + { + $this->mustache->setPartials($partials); + $tpl = $this->mustache->loadTemplate($template); + $this->assertSame($expect, $tpl->render($data)); + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Functional/MustacheInjectionTest.php b/vendor/mustache/mustache/test/Mustache/Test/Functional/MustacheInjectionTest.php new file mode 100644 index 00000000..7a9d6acd --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/Functional/MustacheInjectionTest.php @@ -0,0 +1,83 @@ +mustache = new Mustache_Engine(); + } + + /** + * @dataProvider injectionData + */ + public function testInjection($tpl, $data, $partials, $expect) + { + $this->mustache->setPartials($partials); + $this->assertEquals($expect, $this->mustache->render($tpl, $data)); + } + + public function injectionData() + { + $interpolationData = array( + 'a' => '{{ b }}', + 'b' => 'FAIL', + ); + + $sectionData = array( + 'a' => true, + 'b' => '{{ c }}', + 'c' => 'FAIL', + ); + + $lambdaInterpolationData = array( + 'a' => array($this, 'lambdaInterpolationCallback'), + 'b' => '{{ c }}', + 'c' => 'FAIL', + ); + + $lambdaSectionData = array( + 'a' => array($this, 'lambdaSectionCallback'), + 'b' => '{{ c }}', + 'c' => 'FAIL', + ); + + return array( + array('{{ a }}', $interpolationData, array(), '{{ b }}'), + array('{{{ a }}}', $interpolationData, array(), '{{ b }}'), + + array('{{# a }}{{ b }}{{/ a }}', $sectionData, array(), '{{ c }}'), + array('{{# a }}{{{ b }}}{{/ a }}', $sectionData, array(), '{{ c }}'), + + array('{{> partial }}', $interpolationData, array('partial' => '{{ a }}'), '{{ b }}'), + array('{{> partial }}', $interpolationData, array('partial' => '{{{ a }}}'), '{{ b }}'), + + array('{{ a }}', $lambdaInterpolationData, array(), '{{ c }}'), + array('{{# a }}b{{/ a }}', $lambdaSectionData, array(), '{{ c }}'), + ); + } + + public static function lambdaInterpolationCallback() + { + return '{{ b }}'; + } + + public static function lambdaSectionCallback($text) + { + return '{{ ' . $text . ' }}'; + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Functional/MustacheSpecTest.php b/vendor/mustache/mustache/test/Mustache/Test/Functional/MustacheSpecTest.php new file mode 100644 index 00000000..6cde602e --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/Functional/MustacheSpecTest.php @@ -0,0 +1,121 @@ +markTestSkipped('Mustache spec submodule not initialized: run "git submodule update --init"'); + } + } + + /** + * @group comments + * @dataProvider loadCommentSpec + */ + public function testCommentSpec($desc, $source, $partials, $data, $expected) + { + $template = self::loadTemplate($source, $partials); + $this->assertEquals($expected, $template->render($data), $desc); + } + + public function loadCommentSpec() + { + return $this->loadSpec('comments'); + } + + /** + * @group delimiters + * @dataProvider loadDelimitersSpec + */ + public function testDelimitersSpec($desc, $source, $partials, $data, $expected) + { + $template = self::loadTemplate($source, $partials); + $this->assertEquals($expected, $template->render($data), $desc); + } + + public function loadDelimitersSpec() + { + return $this->loadSpec('delimiters'); + } + + /** + * @group interpolation + * @dataProvider loadInterpolationSpec + */ + public function testInterpolationSpec($desc, $source, $partials, $data, $expected) + { + $template = self::loadTemplate($source, $partials); + $this->assertEquals($expected, $template->render($data), $desc); + } + + public function loadInterpolationSpec() + { + return $this->loadSpec('interpolation'); + } + + /** + * @group inverted + * @group inverted-sections + * @dataProvider loadInvertedSpec + */ + public function testInvertedSpec($desc, $source, $partials, $data, $expected) + { + $template = self::loadTemplate($source, $partials); + $this->assertEquals($expected, $template->render($data), $desc); + } + + public function loadInvertedSpec() + { + return $this->loadSpec('inverted'); + } + + /** + * @group partials + * @dataProvider loadPartialsSpec + */ + public function testPartialsSpec($desc, $source, $partials, $data, $expected) + { + $template = self::loadTemplate($source, $partials); + $this->assertEquals($expected, $template->render($data), $desc); + } + + public function loadPartialsSpec() + { + return $this->loadSpec('partials'); + } + + /** + * @group sections + * @dataProvider loadSectionsSpec + */ + public function testSectionsSpec($desc, $source, $partials, $data, $expected) + { + $template = self::loadTemplate($source, $partials); + $this->assertEquals($expected, $template->render($data), $desc); + } + + public function loadSectionsSpec() + { + return $this->loadSpec('sections'); + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Functional/NestedPartialIndentTest.php b/vendor/mustache/mustache/test/Mustache/Test/Functional/NestedPartialIndentTest.php new file mode 100644 index 00000000..90af4d95 --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/Functional/NestedPartialIndentTest.php @@ -0,0 +1,45 @@ + $partials, + )); + $tpl = $m->loadTemplate($src); + $this->assertEquals($expected, $tpl->render()); + } + + public function partialsAndStuff() + { + $partials = array( + 'a' => ' {{> b }}', + 'b' => ' {{> d }}', + 'c' => ' {{> d }}{{> d }}', + 'd' => 'D!', + ); + + return array( + array(' {{> a }}', $partials, ' D!'), + array(' {{> b }}', $partials, ' D!'), + array(' {{> c }}', $partials, ' D!D!'), + ); + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Functional/ObjectSectionTest.php b/vendor/mustache/mustache/test/Mustache/Test/Functional/ObjectSectionTest.php new file mode 100644 index 00000000..3cf01e18 --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/Functional/ObjectSectionTest.php @@ -0,0 +1,110 @@ +mustache = new Mustache_Engine(); + } + + public function testBasicObject() + { + $tpl = $this->mustache->loadTemplate('{{#foo}}{{name}}{{/foo}}'); + $this->assertEquals('Foo', $tpl->render(new Mustache_Test_Functional_Alpha())); + } + + /** + * @group magic_methods + */ + public function testObjectWithGet() + { + $tpl = $this->mustache->loadTemplate('{{#foo}}{{name}}{{/foo}}'); + $this->assertEquals('Foo', $tpl->render(new Mustache_Test_Functional_Beta())); + } + + /** + * @group magic_methods + */ + public function testSectionObjectWithGet() + { + $tpl = $this->mustache->loadTemplate('{{#bar}}{{#foo}}{{name}}{{/foo}}{{/bar}}'); + $this->assertEquals('Foo', $tpl->render(new Mustache_Test_Functional_Gamma())); + } + + public function testSectionObjectWithFunction() + { + $tpl = $this->mustache->loadTemplate('{{#foo}}{{name}}{{/foo}}'); + $alpha = new Mustache_Test_Functional_Alpha(); + $alpha->foo = new Mustache_Test_Functional_Delta(); + $this->assertEquals('Foo', $tpl->render($alpha)); + } +} + +class Mustache_Test_Functional_Alpha +{ + public $foo; + + public function __construct() + { + $this->foo = new StdClass(); + $this->foo->name = 'Foo'; + $this->foo->number = 1; + } +} + +class Mustache_Test_Functional_Beta +{ + protected $_data = array(); + + public function __construct() + { + $this->_data['foo'] = new StdClass(); + $this->_data['foo']->name = 'Foo'; + $this->_data['foo']->number = 1; + } + + public function __isset($name) + { + return array_key_exists($name, $this->_data); + } + + public function __get($name) + { + return $this->_data[$name]; + } +} + +class Mustache_Test_Functional_Gamma +{ + public $bar; + + public function __construct() + { + $this->bar = new Mustache_Test_Functional_Beta(); + } +} + +class Mustache_Test_Functional_Delta +{ + protected $_name = 'Foo'; + + public function name() + { + return $this->_name; + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/FunctionalTestCase.php b/vendor/mustache/mustache/test/Mustache/Test/FunctionalTestCase.php new file mode 100644 index 00000000..213b045e --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/FunctionalTestCase.php @@ -0,0 +1,47 @@ + $foo, + 'bar' => $bar, + )); + + $this->assertSame($foo, $helpers->get('foo')); + $this->assertSame($bar, $helpers->get('bar')); + } + + public static function getFoo() + { + echo 'foo'; + } + + public function testAccessorsAndMutators() + { + $foo = array($this, 'getFoo'); + $bar = 'BAR'; + + $helpers = new Mustache_HelperCollection(); + $this->assertTrue($helpers->isEmpty()); + $this->assertFalse($helpers->has('foo')); + $this->assertFalse($helpers->has('bar')); + + $helpers->add('foo', $foo); + $this->assertFalse($helpers->isEmpty()); + $this->assertTrue($helpers->has('foo')); + $this->assertFalse($helpers->has('bar')); + + $helpers->add('bar', $bar); + $this->assertFalse($helpers->isEmpty()); + $this->assertTrue($helpers->has('foo')); + $this->assertTrue($helpers->has('bar')); + + $helpers->remove('foo'); + $this->assertFalse($helpers->isEmpty()); + $this->assertFalse($helpers->has('foo')); + $this->assertTrue($helpers->has('bar')); + } + + public function testMagicMethods() + { + $foo = array($this, 'getFoo'); + $bar = 'BAR'; + + $helpers = new Mustache_HelperCollection(); + $this->assertTrue($helpers->isEmpty()); + $this->assertFalse($helpers->has('foo')); + $this->assertFalse($helpers->has('bar')); + $this->assertFalse(isset($helpers->foo)); + $this->assertFalse(isset($helpers->bar)); + + $helpers->foo = $foo; + $this->assertFalse($helpers->isEmpty()); + $this->assertTrue($helpers->has('foo')); + $this->assertFalse($helpers->has('bar')); + $this->assertTrue(isset($helpers->foo)); + $this->assertFalse(isset($helpers->bar)); + + $helpers->bar = $bar; + $this->assertFalse($helpers->isEmpty()); + $this->assertTrue($helpers->has('foo')); + $this->assertTrue($helpers->has('bar')); + $this->assertTrue(isset($helpers->foo)); + $this->assertTrue(isset($helpers->bar)); + + unset($helpers->foo); + $this->assertFalse($helpers->isEmpty()); + $this->assertFalse($helpers->has('foo')); + $this->assertTrue($helpers->has('bar')); + $this->assertFalse(isset($helpers->foo)); + $this->assertTrue(isset($helpers->bar)); + } + + /** + * @dataProvider getInvalidHelperArguments + */ + public function testHelperCollectionIsntAfraidToThrowExceptions($helpers = array(), $actions = array(), $exception = null) + { + if ($exception) { + $this->setExpectedException($exception); + } + + $helpers = new Mustache_HelperCollection($helpers); + + foreach ($actions as $method => $args) { + call_user_func_array(array($helpers, $method), $args); + } + } + + public function getInvalidHelperArguments() + { + return array( + array( + 'not helpers', + array(), + 'InvalidArgumentException', + ), + array( + array(), + array('get' => array('foo')), + 'InvalidArgumentException', + ), + array( + array('foo' => 'FOO'), + array('get' => array('foo')), + null, + ), + array( + array('foo' => 'FOO'), + array('get' => array('bar')), + 'InvalidArgumentException', + ), + array( + array('foo' => 'FOO'), + array( + 'add' => array('bar', 'BAR'), + 'get' => array('bar'), + ), + null, + ), + array( + array('foo' => 'FOO'), + array( + 'get' => array('foo'), + 'remove' => array('foo'), + ), + null, + ), + array( + array('foo' => 'FOO'), + array( + 'remove' => array('foo'), + 'get' => array('foo'), + ), + 'InvalidArgumentException', + ), + array( + array(), + array('remove' => array('foo')), + 'InvalidArgumentException', + ), + ); + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Loader/ArrayLoaderTest.php b/vendor/mustache/mustache/test/Mustache/Test/Loader/ArrayLoaderTest.php new file mode 100644 index 00000000..1f309878 --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/Loader/ArrayLoaderTest.php @@ -0,0 +1,52 @@ + 'bar', + )); + + $this->assertEquals('bar', $loader->load('foo')); + } + + public function testSetAndLoadTemplates() + { + $loader = new Mustache_Loader_ArrayLoader(array( + 'foo' => 'bar', + )); + $this->assertEquals('bar', $loader->load('foo')); + + $loader->setTemplate('baz', 'qux'); + $this->assertEquals('qux', $loader->load('baz')); + + $loader->setTemplates(array( + 'foo' => 'FOO', + 'baz' => 'BAZ', + )); + $this->assertEquals('FOO', $loader->load('foo')); + $this->assertEquals('BAZ', $loader->load('baz')); + } + + /** + * @expectedException Mustache_Exception_UnknownTemplateException + */ + public function testMissingTemplatesThrowExceptions() + { + $loader = new Mustache_Loader_ArrayLoader(); + $loader->load('not_a_real_template'); + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Loader/CascadingLoaderTest.php b/vendor/mustache/mustache/test/Mustache/Test/Loader/CascadingLoaderTest.php new file mode 100644 index 00000000..ecf80d6f --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/Loader/CascadingLoaderTest.php @@ -0,0 +1,40 @@ + '{{ foo }}')), + new Mustache_Loader_ArrayLoader(array('bar' => '{{#bar}}BAR{{/bar}}')), + )); + + $this->assertEquals('{{ foo }}', $loader->load('foo')); + $this->assertEquals('{{#bar}}BAR{{/bar}}', $loader->load('bar')); + } + + /** + * @expectedException Mustache_Exception_UnknownTemplateException + */ + public function testMissingTemplatesThrowExceptions() + { + $loader = new Mustache_Loader_CascadingLoader(array( + new Mustache_Loader_ArrayLoader(array('foo' => '{{ foo }}')), + new Mustache_Loader_ArrayLoader(array('bar' => '{{#bar}}BAR{{/bar}}')), + )); + + $loader->load('not_a_real_template'); + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Loader/FilesystemLoaderTest.php b/vendor/mustache/mustache/test/Mustache/Test/Loader/FilesystemLoaderTest.php new file mode 100644 index 00000000..8c06e76b --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/Loader/FilesystemLoaderTest.php @@ -0,0 +1,80 @@ + '.ms')); + $this->assertEquals('alpha contents', $loader->load('alpha')); + $this->assertEquals('beta contents', $loader->load('beta.ms')); + } + + public function testTrailingSlashes() + { + $baseDir = dirname(__FILE__) . '/../../../fixtures/templates/'; + $loader = new Mustache_Loader_FilesystemLoader($baseDir); + $this->assertEquals('one contents', $loader->load('one')); + } + + public function testConstructorWithProtocol() + { + $baseDir = realpath(dirname(__FILE__) . '/../../../fixtures/templates'); + + $loader = new Mustache_Loader_FilesystemLoader('test://' . $baseDir, array('extension' => '.ms')); + $this->assertEquals('alpha contents', $loader->load('alpha')); + $this->assertEquals('beta contents', $loader->load('beta.ms')); + } + + public function testLoadTemplates() + { + $baseDir = realpath(dirname(__FILE__) . '/../../../fixtures/templates'); + $loader = new Mustache_Loader_FilesystemLoader($baseDir); + $this->assertEquals('one contents', $loader->load('one')); + $this->assertEquals('two contents', $loader->load('two.mustache')); + } + + public function testEmptyExtensionString() + { + $baseDir = realpath(dirname(__FILE__) . '/../../../fixtures/templates'); + + $loader = new Mustache_Loader_FilesystemLoader($baseDir, array('extension' => '')); + $this->assertEquals('one contents', $loader->load('one.mustache')); + $this->assertEquals('alpha contents', $loader->load('alpha.ms')); + + $loader = new Mustache_Loader_FilesystemLoader($baseDir, array('extension' => null)); + $this->assertEquals('two contents', $loader->load('two.mustache')); + $this->assertEquals('beta contents', $loader->load('beta.ms')); + } + + /** + * @expectedException Mustache_Exception_RuntimeException + */ + public function testMissingBaseDirThrowsException() + { + new Mustache_Loader_FilesystemLoader(dirname(__FILE__) . '/not_a_directory'); + } + + /** + * @expectedException Mustache_Exception_UnknownTemplateException + */ + public function testMissingTemplateThrowsException() + { + $baseDir = realpath(dirname(__FILE__) . '/../../../fixtures/templates'); + $loader = new Mustache_Loader_FilesystemLoader($baseDir); + + $loader->load('fake'); + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Loader/InlineLoaderTest.php b/vendor/mustache/mustache/test/Mustache/Test/Loader/InlineLoaderTest.php new file mode 100644 index 00000000..24f2e0b3 --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/Loader/InlineLoaderTest.php @@ -0,0 +1,56 @@ +assertEquals('{{ foo }}', $loader->load('foo')); + $this->assertEquals('{{#bar}}BAR{{/bar}}', $loader->load('bar')); + } + + /** + * @expectedException Mustache_Exception_UnknownTemplateException + */ + public function testMissingTemplatesThrowExceptions() + { + $loader = new Mustache_Loader_InlineLoader(__FILE__, __COMPILER_HALT_OFFSET__); + $loader->load('not_a_real_template'); + } + + /** + * @expectedException Mustache_Exception_InvalidArgumentException + */ + public function testInvalidOffsetThrowsException() + { + new Mustache_Loader_InlineLoader(__FILE__, 'notanumber'); + } + + /** + * @expectedException Mustache_Exception_InvalidArgumentException + */ + public function testInvalidFileThrowsException() + { + new Mustache_Loader_InlineLoader('notarealfile', __COMPILER_HALT_OFFSET__); + } +} + +__halt_compiler(); + +@@ foo +{{ foo }} + +@@ bar +{{#bar}}BAR{{/bar}} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Loader/ProductionFilesystemLoaderTest.php b/vendor/mustache/mustache/test/Mustache/Test/Loader/ProductionFilesystemLoaderTest.php new file mode 100644 index 00000000..0c7c7e30 --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/Loader/ProductionFilesystemLoaderTest.php @@ -0,0 +1,103 @@ + '.ms')); + $this->assertInstanceOf('Mustache_Source', $loader->load('alpha')); + $this->assertEquals('alpha contents', $loader->load('alpha')->getSource()); + $this->assertInstanceOf('Mustache_Source', $loader->load('beta.ms')); + $this->assertEquals('beta contents', $loader->load('beta.ms')->getSource()); + } + + public function testTrailingSlashes() + { + $baseDir = dirname(__FILE__) . '/../../../fixtures/templates/'; + $loader = new Mustache_Loader_ProductionFilesystemLoader($baseDir); + $this->assertEquals('one contents', $loader->load('one')->getSource()); + } + + public function testConstructorWithProtocol() + { + $baseDir = realpath(dirname(__FILE__) . '/../../../fixtures/templates'); + + $loader = new Mustache_Loader_ProductionFilesystemLoader('file://' . $baseDir, array('extension' => '.ms')); + $this->assertEquals('alpha contents', $loader->load('alpha')->getSource()); + $this->assertEquals('beta contents', $loader->load('beta.ms')->getSource()); + } + + public function testLoadTemplates() + { + $baseDir = realpath(dirname(__FILE__) . '/../../../fixtures/templates'); + $loader = new Mustache_Loader_ProductionFilesystemLoader($baseDir); + $this->assertEquals('one contents', $loader->load('one')->getSource()); + $this->assertEquals('two contents', $loader->load('two.mustache')->getSource()); + } + + public function testEmptyExtensionString() + { + $baseDir = realpath(dirname(__FILE__) . '/../../../fixtures/templates'); + + $loader = new Mustache_Loader_ProductionFilesystemLoader($baseDir, array('extension' => '')); + $this->assertEquals('one contents', $loader->load('one.mustache')->getSource()); + $this->assertEquals('alpha contents', $loader->load('alpha.ms')->getSource()); + + $loader = new Mustache_Loader_ProductionFilesystemLoader($baseDir, array('extension' => null)); + $this->assertEquals('two contents', $loader->load('two.mustache')->getSource()); + $this->assertEquals('beta contents', $loader->load('beta.ms')->getSource()); + } + + /** + * @expectedException Mustache_Exception_RuntimeException + */ + public function testMissingBaseDirThrowsException() + { + new Mustache_Loader_ProductionFilesystemLoader(dirname(__FILE__) . '/not_a_directory'); + } + + /** + * @expectedException Mustache_Exception_UnknownTemplateException + */ + public function testMissingTemplateThrowsException() + { + $baseDir = realpath(dirname(__FILE__) . '/../../../fixtures/templates'); + $loader = new Mustache_Loader_ProductionFilesystemLoader($baseDir); + + $loader->load('fake'); + } + + public function testLoadWithDifferentStatProps() + { + $baseDir = realpath(dirname(__FILE__) . '/../../../fixtures/templates'); + $noStatLoader = new Mustache_Loader_ProductionFilesystemLoader($baseDir, array('stat_props' => null)); + $mtimeLoader = new Mustache_Loader_ProductionFilesystemLoader($baseDir, array('stat_props' => array('mtime'))); + $sizeLoader = new Mustache_Loader_ProductionFilesystemLoader($baseDir, array('stat_props' => array('size'))); + $bothLoader = new Mustache_Loader_ProductionFilesystemLoader($baseDir, array('stat_props' => array('mtime', 'size'))); + + $noStatKey = $noStatLoader->load('one.mustache')->getKey(); + $mtimeKey = $mtimeLoader->load('one.mustache')->getKey(); + $sizeKey = $sizeLoader->load('one.mustache')->getKey(); + $bothKey = $bothLoader->load('one.mustache')->getKey(); + + $this->assertNotEquals($noStatKey, $mtimeKey); + $this->assertNotEquals($noStatKey, $sizeKey); + $this->assertNotEquals($noStatKey, $bothKey); + $this->assertNotEquals($mtimeKey, $sizeKey); + $this->assertNotEquals($mtimeKey, $bothKey); + $this->assertNotEquals($sizeKey, $bothKey); + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Loader/StringLoaderTest.php b/vendor/mustache/mustache/test/Mustache/Test/Loader/StringLoaderTest.php new file mode 100644 index 00000000..5896f00b --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/Loader/StringLoaderTest.php @@ -0,0 +1,25 @@ +assertEquals('foo', $loader->load('foo')); + $this->assertEquals('{{ bar }}', $loader->load('{{ bar }}')); + $this->assertEquals("\n{{! comment }}\n", $loader->load("\n{{! comment }}\n")); + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Logger/AbstractLoggerTest.php b/vendor/mustache/mustache/test/Mustache/Test/Logger/AbstractLoggerTest.php new file mode 100644 index 00000000..19dc27cd --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/Logger/AbstractLoggerTest.php @@ -0,0 +1,60 @@ +emergency('emergency message'); + $logger->alert('alert message'); + $logger->critical('critical message'); + $logger->error('error message'); + $logger->warning('warning message'); + $logger->notice('notice message'); + $logger->info('info message'); + $logger->debug('debug message'); + + $expected = array( + array(Mustache_Logger::EMERGENCY, 'emergency message', array()), + array(Mustache_Logger::ALERT, 'alert message', array()), + array(Mustache_Logger::CRITICAL, 'critical message', array()), + array(Mustache_Logger::ERROR, 'error message', array()), + array(Mustache_Logger::WARNING, 'warning message', array()), + array(Mustache_Logger::NOTICE, 'notice message', array()), + array(Mustache_Logger::INFO, 'info message', array()), + array(Mustache_Logger::DEBUG, 'debug message', array()), + ); + + $this->assertEquals($expected, $logger->log); + } +} + +class Mustache_Test_Logger_TestLogger extends Mustache_Logger_AbstractLogger +{ + public $log = array(); + + /** + * Logs with an arbitrary level. + * + * @param mixed $level + * @param string $message + * @param array $context + */ + public function log($level, $message, array $context = array()) + { + $this->log[] = array($level, $message, $context); + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Logger/StreamLoggerTest.php b/vendor/mustache/mustache/test/Mustache/Test/Logger/StreamLoggerTest.php new file mode 100644 index 00000000..fc1a06f1 --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/Logger/StreamLoggerTest.php @@ -0,0 +1,209 @@ +log(Mustache_Logger::CRITICAL, 'message'); + + $this->assertEquals("CRITICAL: message\n", file_get_contents($name)); + } + + public function acceptsStreamData() + { + $one = tempnam(sys_get_temp_dir(), 'mustache-test'); + $two = tempnam(sys_get_temp_dir(), 'mustache-test'); + + return array( + array($one, $one), + array($two, fopen($two, 'a')), + ); + } + + /** + * @expectedException Mustache_Exception_LogicException + */ + public function testPrematurelyClosedStreamThrowsException() + { + $stream = tmpfile(); + $logger = new Mustache_Logger_StreamLogger($stream); + fclose($stream); + + $logger->log(Mustache_Logger::CRITICAL, 'message'); + } + + /** + * @dataProvider getLevels + */ + public function testLoggingThresholds($logLevel, $level, $shouldLog) + { + $stream = tmpfile(); + $logger = new Mustache_Logger_StreamLogger($stream, $logLevel); + $logger->log($level, 'logged'); + + rewind($stream); + $result = fread($stream, 1024); + + if ($shouldLog) { + $this->assertContains('logged', $result); + } else { + $this->assertEmpty($result); + } + } + + public function getLevels() + { + // $logLevel, $level, $shouldLog + return array( + // identities + array(Mustache_Logger::EMERGENCY, Mustache_Logger::EMERGENCY, true), + array(Mustache_Logger::ALERT, Mustache_Logger::ALERT, true), + array(Mustache_Logger::CRITICAL, Mustache_Logger::CRITICAL, true), + array(Mustache_Logger::ERROR, Mustache_Logger::ERROR, true), + array(Mustache_Logger::WARNING, Mustache_Logger::WARNING, true), + array(Mustache_Logger::NOTICE, Mustache_Logger::NOTICE, true), + array(Mustache_Logger::INFO, Mustache_Logger::INFO, true), + array(Mustache_Logger::DEBUG, Mustache_Logger::DEBUG, true), + + // one above + array(Mustache_Logger::ALERT, Mustache_Logger::EMERGENCY, true), + array(Mustache_Logger::CRITICAL, Mustache_Logger::ALERT, true), + array(Mustache_Logger::ERROR, Mustache_Logger::CRITICAL, true), + array(Mustache_Logger::WARNING, Mustache_Logger::ERROR, true), + array(Mustache_Logger::NOTICE, Mustache_Logger::WARNING, true), + array(Mustache_Logger::INFO, Mustache_Logger::NOTICE, true), + array(Mustache_Logger::DEBUG, Mustache_Logger::INFO, true), + + // one below + array(Mustache_Logger::EMERGENCY, Mustache_Logger::ALERT, false), + array(Mustache_Logger::ALERT, Mustache_Logger::CRITICAL, false), + array(Mustache_Logger::CRITICAL, Mustache_Logger::ERROR, false), + array(Mustache_Logger::ERROR, Mustache_Logger::WARNING, false), + array(Mustache_Logger::WARNING, Mustache_Logger::NOTICE, false), + array(Mustache_Logger::NOTICE, Mustache_Logger::INFO, false), + array(Mustache_Logger::INFO, Mustache_Logger::DEBUG, false), + ); + } + + /** + * @dataProvider getLogMessages + */ + public function testLogging($level, $message, $context, $expected) + { + $stream = tmpfile(); + $logger = new Mustache_Logger_StreamLogger($stream, Mustache_Logger::DEBUG); + $logger->log($level, $message, $context); + + rewind($stream); + $result = fread($stream, 1024); + + $this->assertEquals($expected, $result); + } + + public function getLogMessages() + { + // $level, $message, $context, $expected + return array( + array(Mustache_Logger::DEBUG, 'debug message', array(), "DEBUG: debug message\n"), + array(Mustache_Logger::INFO, 'info message', array(), "INFO: info message\n"), + array(Mustache_Logger::NOTICE, 'notice message', array(), "NOTICE: notice message\n"), + array(Mustache_Logger::WARNING, 'warning message', array(), "WARNING: warning message\n"), + array(Mustache_Logger::ERROR, 'error message', array(), "ERROR: error message\n"), + array(Mustache_Logger::CRITICAL, 'critical message', array(), "CRITICAL: critical message\n"), + array(Mustache_Logger::ALERT, 'alert message', array(), "ALERT: alert message\n"), + array(Mustache_Logger::EMERGENCY, 'emergency message', array(), "EMERGENCY: emergency message\n"), + + // with context + array( + Mustache_Logger::ERROR, + 'error message', + array('name' => 'foo', 'number' => 42), + "ERROR: error message\n", + ), + + // with interpolation + array( + Mustache_Logger::ERROR, + 'error {name}-{number}', + array('name' => 'foo', 'number' => 42), + "ERROR: error foo-42\n", + ), + + // with iterpolation false positive + array( + Mustache_Logger::ERROR, + 'error {nothing}', + array('name' => 'foo', 'number' => 42), + "ERROR: error {nothing}\n", + ), + + // with interpolation injection + array( + Mustache_Logger::ERROR, + '{foo}', + array('foo' => '{bar}', 'bar' => 'FAIL'), + "ERROR: {bar}\n", + ), + ); + } + + public function testChangeLoggingLevels() + { + $stream = tmpfile(); + $logger = new Mustache_Logger_StreamLogger($stream); + + $logger->setLevel(Mustache_Logger::ERROR); + $this->assertEquals(Mustache_Logger::ERROR, $logger->getLevel()); + + $logger->log(Mustache_Logger::WARNING, 'ignore this'); + + $logger->setLevel(Mustache_Logger::INFO); + $this->assertEquals(Mustache_Logger::INFO, $logger->getLevel()); + + $logger->log(Mustache_Logger::WARNING, 'log this'); + + $logger->setLevel(Mustache_Logger::CRITICAL); + $this->assertEquals(Mustache_Logger::CRITICAL, $logger->getLevel()); + + $logger->log(Mustache_Logger::ERROR, 'ignore this'); + + rewind($stream); + $result = fread($stream, 1024); + + $this->assertEquals("WARNING: log this\n", $result); + } + + /** + * @expectedException Mustache_Exception_InvalidArgumentException + */ + public function testThrowsInvalidArgumentExceptionWhenSettingUnknownLevels() + { + $logger = new Mustache_Logger_StreamLogger(tmpfile()); + $logger->setLevel('bacon'); + } + + /** + * @expectedException Mustache_Exception_InvalidArgumentException + */ + public function testThrowsInvalidArgumentExceptionWhenLoggingUnknownLevels() + { + $logger = new Mustache_Logger_StreamLogger(tmpfile()); + $logger->log('bacon', 'CODE BACON ERROR!'); + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/ParserTest.php b/vendor/mustache/mustache/test/Mustache/Test/ParserTest.php new file mode 100644 index 00000000..d8458f76 --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/ParserTest.php @@ -0,0 +1,425 @@ +assertEquals($expected, $parser->parse($tokens)); + } + + public function getTokenSets() + { + return array( + array( + array(), + array(), + ), + + array( + array(array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::VALUE => 'text', + )), + array(array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::VALUE => 'text', + )), + ), + + array( + array(array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::NAME => 'name', + )), + array(array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::NAME => 'name', + )), + ), + + array( + array( + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::VALUE => 'foo', + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_INVERTED, + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::INDEX => 123, + Mustache_Tokenizer::NAME => 'parent', + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::NAME => 'name', + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_END_SECTION, + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::INDEX => 456, + Mustache_Tokenizer::NAME => 'parent', + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::VALUE => 'bar', + ), + ), + + array( + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::VALUE => 'foo', + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_INVERTED, + Mustache_Tokenizer::NAME => 'parent', + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::INDEX => 123, + Mustache_Tokenizer::END => 456, + Mustache_Tokenizer::NODES => array( + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::NAME => 'name', + ), + ), + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::VALUE => 'bar', + ), + ), + ), + + // This *would* be an invalid inheritance parse tree, but that pragma + // isn't enabled so it'll thunk it back into an "escaped" token: + array( + array( + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_BLOCK_VAR, + Mustache_Tokenizer::NAME => 'foo', + Mustache_Tokenizer::OTAG => '{{', + Mustache_Tokenizer::CTAG => '}}', + Mustache_Tokenizer::LINE => 0, + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::VALUE => 'bar', + ), + ), + array( + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, + Mustache_Tokenizer::NAME => '$foo', + Mustache_Tokenizer::OTAG => '{{', + Mustache_Tokenizer::CTAG => '}}', + Mustache_Tokenizer::LINE => 0, + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::VALUE => 'bar', + ), + ), + ), + + array( + array( + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::VALUE => ' ', + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_DELIM_CHANGE, + Mustache_Tokenizer::LINE => 0, + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::VALUE => " \n", + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, + Mustache_Tokenizer::NAME => 'foo', + Mustache_Tokenizer::OTAG => '[[', + Mustache_Tokenizer::CTAG => ']]', + Mustache_Tokenizer::LINE => 1, + ), + ), + array( + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, + Mustache_Tokenizer::NAME => 'foo', + Mustache_Tokenizer::OTAG => '[[', + Mustache_Tokenizer::CTAG => ']]', + Mustache_Tokenizer::LINE => 1, + ), + ), + ), + + ); + } + + /** + * @dataProvider getInheritanceTokenSets + */ + public function testParseWithInheritance($tokens, $expected) + { + $parser = new Mustache_Parser(); + $parser->setPragmas(array(Mustache_Engine::PRAGMA_BLOCKS)); + $this->assertEquals($expected, $parser->parse($tokens)); + } + + public function getInheritanceTokenSets() + { + return array( + array( + array( + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_PARENT, + Mustache_Tokenizer::NAME => 'foo', + Mustache_Tokenizer::OTAG => '{{', + Mustache_Tokenizer::CTAG => '}}', + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::INDEX => 8, + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_BLOCK_VAR, + Mustache_Tokenizer::NAME => 'bar', + Mustache_Tokenizer::OTAG => '{{', + Mustache_Tokenizer::CTAG => '}}', + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::INDEX => 16, + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::VALUE => 'baz', + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_END_SECTION, + Mustache_Tokenizer::NAME => 'bar', + Mustache_Tokenizer::OTAG => '{{', + Mustache_Tokenizer::CTAG => '}}', + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::INDEX => 19, + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_END_SECTION, + Mustache_Tokenizer::NAME => 'foo', + Mustache_Tokenizer::OTAG => '{{', + Mustache_Tokenizer::CTAG => '}}', + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::INDEX => 27, + ), + ), + array( + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_PARENT, + Mustache_Tokenizer::NAME => 'foo', + Mustache_Tokenizer::OTAG => '{{', + Mustache_Tokenizer::CTAG => '}}', + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::INDEX => 8, + Mustache_Tokenizer::END => 27, + Mustache_Tokenizer::NODES => array( + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_BLOCK_ARG, + Mustache_Tokenizer::NAME => 'bar', + Mustache_Tokenizer::OTAG => '{{', + Mustache_Tokenizer::CTAG => '}}', + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::INDEX => 16, + Mustache_Tokenizer::END => 19, + Mustache_Tokenizer::NODES => array( + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::VALUE => 'baz', + ), + ), + ), + ), + ), + ), + ), + + array( + array( + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_BLOCK_VAR, + Mustache_Tokenizer::NAME => 'foo', + Mustache_Tokenizer::OTAG => '{{', + Mustache_Tokenizer::CTAG => '}}', + Mustache_Tokenizer::LINE => 0, + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::VALUE => 'bar', + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_END_SECTION, + Mustache_Tokenizer::NAME => 'foo', + Mustache_Tokenizer::OTAG => '{{', + Mustache_Tokenizer::CTAG => '}}', + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::INDEX => 11, + ), + ), + array( + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_BLOCK_VAR, + Mustache_Tokenizer::NAME => 'foo', + Mustache_Tokenizer::OTAG => '{{', + Mustache_Tokenizer::CTAG => '}}', + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::END => 11, + Mustache_Tokenizer::NODES => array( + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::VALUE => 'bar', + ), + ), + ), + ), + ), + ); + } + + /** + * @dataProvider getBadParseTrees + * @expectedException Mustache_Exception_SyntaxException + */ + public function testParserThrowsExceptions($tokens) + { + $parser = new Mustache_Parser(); + $parser->parse($tokens); + } + + public function getBadParseTrees() + { + return array( + // no close + array( + array( + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_SECTION, + Mustache_Tokenizer::NAME => 'parent', + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::INDEX => 123, + ), + ), + ), + + // no close inverted + array( + array( + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_INVERTED, + Mustache_Tokenizer::NAME => 'parent', + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::INDEX => 123, + ), + ), + ), + + // no opening inverted + array( + array( + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_END_SECTION, + Mustache_Tokenizer::NAME => 'parent', + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::INDEX => 123, + ), + ), + ), + + // weird nesting + array( + array( + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_SECTION, + Mustache_Tokenizer::NAME => 'parent', + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::INDEX => 123, + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_SECTION, + Mustache_Tokenizer::NAME => 'child', + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::INDEX => 123, + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_END_SECTION, + Mustache_Tokenizer::NAME => 'parent', + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::INDEX => 123, + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_END_SECTION, + Mustache_Tokenizer::NAME => 'child', + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::INDEX => 123, + ), + ), + ), + + // This *would* be a valid inheritance parse tree, but that pragma + // isn't enabled here so it's going to fail :) + array( + array( + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_BLOCK_VAR, + Mustache_Tokenizer::NAME => 'foo', + Mustache_Tokenizer::OTAG => '{{', + Mustache_Tokenizer::CTAG => '}}', + Mustache_Tokenizer::LINE => 0, + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::VALUE => 'bar', + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_END_SECTION, + Mustache_Tokenizer::NAME => 'foo', + Mustache_Tokenizer::OTAG => '{{', + Mustache_Tokenizer::CTAG => '}}', + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::INDEX => 11, + ), + ), + ), + ); + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Source/FilesystemSourceTest.php b/vendor/mustache/mustache/test/Mustache/Test/Source/FilesystemSourceTest.php new file mode 100644 index 00000000..a636ffe5 --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/Source/FilesystemSourceTest.php @@ -0,0 +1,25 @@ +getKey(); + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/SpecTestCase.php b/vendor/mustache/mustache/test/Mustache/Test/SpecTestCase.php new file mode 100644 index 00000000..db188dea --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/SpecTestCase.php @@ -0,0 +1,67 @@ +setPartials($partials); + + return self::$mustache->loadTemplate($source); + } + + /** + * Data provider for the mustache spec test. + * + * Loads YAML files from the spec and converts them to PHPisms. + * + * @param string $name + * + * @return array + */ + protected function loadSpec($name) + { + $filename = dirname(__FILE__) . '/../../../vendor/spec/specs/' . $name . '.yml'; + if (!file_exists($filename)) { + return array(); + } + + $data = array(); + $yaml = new sfYamlParser(); + $file = file_get_contents($filename); + + // @hack: pre-process the 'lambdas' spec so the Symfony YAML parser doesn't complain. + if ($name === '~lambdas') { + $file = str_replace(" !code\n", "\n", $file); + } + + $spec = $yaml->parse($file); + + foreach ($spec['tests'] as $test) { + $data[] = array( + $test['name'] . ': ' . $test['desc'], + $test['template'], + isset($test['partials']) ? $test['partials'] : array(), + $test['data'], + $test['expected'], + ); + } + + return $data; + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/TemplateTest.php b/vendor/mustache/mustache/test/Mustache/Test/TemplateTest.php new file mode 100644 index 00000000..60065aad --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/TemplateTest.php @@ -0,0 +1,55 @@ +assertSame($mustache, $template->getMustache()); + } + + public function testRendering() + { + $rendered = '<< wheee >>'; + $mustache = new Mustache_Engine(); + $template = new Mustache_Test_TemplateStub($mustache); + $template->rendered = $rendered; + $context = new Mustache_Context(); + + if (version_compare(PHP_VERSION, '5.3.0', '>=')) { + $this->assertEquals($rendered, $template()); + } + + $this->assertEquals($rendered, $template->render()); + $this->assertEquals($rendered, $template->renderInternal($context)); + $this->assertEquals($rendered, $template->render(array('foo' => 'bar'))); + } +} + +class Mustache_Test_TemplateStub extends Mustache_Template +{ + public $rendered; + + public function getMustache() + { + return $this->mustache; + } + + public function renderInternal(Mustache_Context $context, $indent = '', $escape = false) + { + return $this->rendered; + } +} diff --git a/vendor/mustache/mustache/test/Mustache/Test/TokenizerTest.php b/vendor/mustache/mustache/test/Mustache/Test/TokenizerTest.php new file mode 100644 index 00000000..38f16dc4 --- /dev/null +++ b/vendor/mustache/mustache/test/Mustache/Test/TokenizerTest.php @@ -0,0 +1,306 @@ +assertSame($expected, $tokenizer->scan($text, $delimiters)); + } + + /** + * @expectedException Mustache_Exception_SyntaxException + */ + public function testUnevenBracesThrowExceptions() + { + $tokenizer = new Mustache_Tokenizer(); + + $text = '{{{ name }}'; + $tokenizer->scan($text, null); + } + + /** + * @expectedException Mustache_Exception_SyntaxException + */ + public function testUnevenBracesWithCustomDelimiterThrowExceptions() + { + $tokenizer = new Mustache_Tokenizer(); + + $text = '<%{ name %>'; + $tokenizer->scan($text, '<% %>'); + } + + public function getTokens() + { + return array( + array( + 'text', + null, + array( + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::VALUE => 'text', + ), + ), + ), + + array( + 'text', + '<<< >>>', + array( + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::VALUE => 'text', + ), + ), + ), + + array( + '{{ name }}', + null, + array( + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, + Mustache_Tokenizer::NAME => 'name', + Mustache_Tokenizer::OTAG => '{{', + Mustache_Tokenizer::CTAG => '}}', + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::INDEX => 10, + ), + ), + ), + + array( + '{{ name }}', + '<<< >>>', + array( + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::VALUE => '{{ name }}', + ), + ), + ), + + array( + '<<< name >>>', + '<<< >>>', + array( + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, + Mustache_Tokenizer::NAME => 'name', + Mustache_Tokenizer::OTAG => '<<<', + Mustache_Tokenizer::CTAG => '>>>', + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::INDEX => 12, + ), + ), + ), + + array( + "{{{ a }}}\n{{# b }} \n{{= | | =}}| c ||/ b |\n|{ d }|", + null, + array( + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_UNESCAPED, + Mustache_Tokenizer::NAME => 'a', + Mustache_Tokenizer::OTAG => '{{', + Mustache_Tokenizer::CTAG => '}}', + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::INDEX => 8, + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::VALUE => "\n", + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_SECTION, + Mustache_Tokenizer::NAME => 'b', + Mustache_Tokenizer::OTAG => '{{', + Mustache_Tokenizer::CTAG => '}}', + Mustache_Tokenizer::LINE => 1, + Mustache_Tokenizer::INDEX => 18, + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, + Mustache_Tokenizer::LINE => 1, + Mustache_Tokenizer::VALUE => " \n", + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_DELIM_CHANGE, + Mustache_Tokenizer::LINE => 2, + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, + Mustache_Tokenizer::NAME => 'c', + Mustache_Tokenizer::OTAG => '|', + Mustache_Tokenizer::CTAG => '|', + Mustache_Tokenizer::LINE => 2, + Mustache_Tokenizer::INDEX => 37, + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_END_SECTION, + Mustache_Tokenizer::NAME => 'b', + Mustache_Tokenizer::OTAG => '|', + Mustache_Tokenizer::CTAG => '|', + Mustache_Tokenizer::LINE => 2, + Mustache_Tokenizer::INDEX => 37, + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, + Mustache_Tokenizer::LINE => 2, + Mustache_Tokenizer::VALUE => "\n", + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_UNESCAPED, + Mustache_Tokenizer::NAME => 'd', + Mustache_Tokenizer::OTAG => '|', + Mustache_Tokenizer::CTAG => '|', + Mustache_Tokenizer::LINE => 3, + Mustache_Tokenizer::INDEX => 51, + ), + + ), + ), + + // See https://github.com/bobthecow/mustache.php/issues/183 + array( + '{{# a }}0{{/ a }}', + null, + array( + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_SECTION, + Mustache_Tokenizer::NAME => 'a', + Mustache_Tokenizer::OTAG => '{{', + Mustache_Tokenizer::CTAG => '}}', + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::INDEX => 8, + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::VALUE => '0', + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_END_SECTION, + Mustache_Tokenizer::NAME => 'a', + Mustache_Tokenizer::OTAG => '{{', + Mustache_Tokenizer::CTAG => '}}', + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::INDEX => 9, + ), + ), + ), + + // custom delimiters don't swallow the next character, even if it is a }, }}}, or the same delimiter + array( + '<% a %>} <% b %>%> <% c %>}}}', + '<% %>', + array( + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, + Mustache_Tokenizer::NAME => 'a', + Mustache_Tokenizer::OTAG => '<%', + Mustache_Tokenizer::CTAG => '%>', + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::INDEX => 7, + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::VALUE => '} ', + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, + Mustache_Tokenizer::NAME => 'b', + Mustache_Tokenizer::OTAG => '<%', + Mustache_Tokenizer::CTAG => '%>', + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::INDEX => 16, + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::VALUE => '%> ', + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, + Mustache_Tokenizer::NAME => 'c', + Mustache_Tokenizer::OTAG => '<%', + Mustache_Tokenizer::CTAG => '%>', + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::INDEX => 26, + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::VALUE => '}}}', + ), + ), + ), + + // unescaped custom delimiters are properly parsed + array( + '<%{ a }%>', + '<% %>', + array( + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_UNESCAPED, + Mustache_Tokenizer::NAME => 'a', + Mustache_Tokenizer::OTAG => '<%', + Mustache_Tokenizer::CTAG => '%>', + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::INDEX => 9, + ), + ), + ), + + // Ensure that $arg token is not picked up during tokenization + array( + '{{$arg}}default{{/arg}}', + null, + array( + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_BLOCK_VAR, + Mustache_Tokenizer::NAME => 'arg', + Mustache_Tokenizer::OTAG => '{{', + Mustache_Tokenizer::CTAG => '}}', + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::INDEX => 8, + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::VALUE => 'default', + ), + array( + Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_END_SECTION, + Mustache_Tokenizer::NAME => 'arg', + Mustache_Tokenizer::OTAG => '{{', + Mustache_Tokenizer::CTAG => '}}', + Mustache_Tokenizer::LINE => 0, + Mustache_Tokenizer::INDEX => 15, + ), + ), + ), + ); + } +} diff --git a/vendor/mustache/mustache/test/bootstrap.php b/vendor/mustache/mustache/test/bootstrap.php new file mode 100644 index 00000000..b3d0a199 --- /dev/null +++ b/vendor/mustache/mustache/test/bootstrap.php @@ -0,0 +1,91 @@ +filehandle = fopen($path, $mode); + + return $this->filehandle !== false; + } + + /** + * @return array + */ + public function stream_stat() + { + return array(); + } + + /** + * @param int $count + * + * @return string + */ + public function stream_read($count) + { + return fgets($this->filehandle, $count); + } + + /** + * @return bool + */ + public function stream_eof() + { + return feof($this->filehandle); + } + + /** + * @return bool + */ + public function stream_close() + { + return fclose($this->filehandle); + } +} + +if (!stream_wrapper_register('test', 'TestStream')) { + die('Failed to register protocol'); +} diff --git a/vendor/mustache/mustache/test/fixtures/autoloader/Mustache/Bar.php b/vendor/mustache/mustache/test/fixtures/autoloader/Mustache/Bar.php new file mode 100644 index 00000000..35c2668b --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/autoloader/Mustache/Bar.php @@ -0,0 +1,15 @@ + 'Punk', + 'subgenres' => array( + array( + 'name' => 'Hardcore', + 'subgenres' => array( + array( + 'name' => 'First wave of black metal', + 'subgenres' => array( + array('name' => 'Norwegian black metal'), + array( + 'name' => 'Death metal', + 'subgenres' => array( + array( + 'name' => 'Swedish death metal', + 'subgenres' => array( + array('name' => 'New wave of American metal'), + ), + ), + ), + ), + ), + ), + array( + 'name' => 'Thrash metal', + 'subgenres' => array( + array('name' => 'Grindcore'), + array( + 'name' => 'Metalcore', + 'subgenres' => array( + array('name' => 'Nu metal'), + ), + ), + ), + ), + ), + ), + ), + ), + ); +} diff --git a/vendor/mustache/mustache/test/fixtures/examples/anchored_dot_notation/anchored_dot_notation.mustache b/vendor/mustache/mustache/test/fixtures/examples/anchored_dot_notation/anchored_dot_notation.mustache new file mode 100644 index 00000000..9494fb10 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/anchored_dot_notation/anchored_dot_notation.mustache @@ -0,0 +1,4 @@ +{{% ANCHORED-DOT }} +{{# genres }} +{{> genre }} +{{/ genres }} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/anchored_dot_notation/anchored_dot_notation.txt b/vendor/mustache/mustache/test/fixtures/examples/anchored_dot_notation/anchored_dot_notation.txt new file mode 100644 index 00000000..fa56efc9 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/anchored_dot_notation/anchored_dot_notation.txt @@ -0,0 +1,11 @@ + - Punk + - Hardcore + - First wave of black metal + - Norwegian black metal + - Death metal + - Swedish death metal + - New wave of American metal + - Thrash metal + - Grindcore + - Metalcore + - Nu metal diff --git a/vendor/mustache/mustache/test/fixtures/examples/anchored_dot_notation/partials/genre.mustache b/vendor/mustache/mustache/test/fixtures/examples/anchored_dot_notation/partials/genre.mustache new file mode 100644 index 00000000..f51c503b --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/anchored_dot_notation/partials/genre.mustache @@ -0,0 +1,5 @@ +{{% ANCHORED-DOT }} + - {{ name }} +{{# .subgenres }} + {{> genre }} +{{/ .subgenres }} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/blocks/Blocks.php b/vendor/mustache/mustache/test/fixtures/examples/blocks/Blocks.php new file mode 100644 index 00000000..6362aca2 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/blocks/Blocks.php @@ -0,0 +1,15 @@ + 'child works', + ); + + public $grandparent = array( + 'parent' => array( + 'child' => 'grandchild works', + ), + ); +} diff --git a/vendor/mustache/mustache/test/fixtures/examples/child_context/child_context.mustache b/vendor/mustache/mustache/test/fixtures/examples/child_context/child_context.mustache new file mode 100644 index 00000000..e1f2ebcb --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/child_context/child_context.mustache @@ -0,0 +1,2 @@ +

{{#parent}}{{child}}{{/parent}}

+

{{#grandparent}}{{#parent}}{{child}}{{/parent}}{{/grandparent}}

\ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/child_context/child_context.txt b/vendor/mustache/mustache/test/fixtures/examples/child_context/child_context.txt new file mode 100644 index 00000000..cfb76bf7 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/child_context/child_context.txt @@ -0,0 +1,2 @@ +

child works

+

grandchild works

\ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/comments/Comments.php b/vendor/mustache/mustache/test/fixtures/examples/comments/Comments.php new file mode 100644 index 00000000..88fe821a --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/comments/Comments.php @@ -0,0 +1,18 @@ +{{title}}{{! just something interesting... #or ^not... }} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/comments/comments.txt b/vendor/mustache/mustache/test/fixtures/examples/comments/comments.txt new file mode 100644 index 00000000..9f40e77b --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/comments/comments.txt @@ -0,0 +1 @@ +

A Comedy of Errors

\ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/complex/complex.mustache b/vendor/mustache/mustache/test/fixtures/examples/complex/complex.mustache new file mode 100644 index 00000000..807c201e --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/complex/complex.mustache @@ -0,0 +1,16 @@ +

{{header}}

+{{#notEmpty}} +
    +{{#item}} +{{#current}} +
  • {{name}}
  • +{{/current}} +{{^current}} +
  • {{name}}
  • +{{/current}} +{{/item}} +
+{{/notEmpty}} +{{#isEmpty}} +

The list is empty.

+{{/isEmpty}} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/complex/complex.php b/vendor/mustache/mustache/test/fixtures/examples/complex/complex.php new file mode 100644 index 00000000..7c696153 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/complex/complex.php @@ -0,0 +1,31 @@ + 'red', 'current' => true, 'url' => '#Red'), + array('name' => 'green', 'current' => false, 'url' => '#Green'), + array('name' => 'blue', 'current' => false, 'url' => '#Blue'), + ); + + public function notEmpty() + { + return !($this->isEmpty()); + } + + public function isEmpty() + { + return count($this->item) === 0; + } +} diff --git a/vendor/mustache/mustache/test/fixtures/examples/complex/complex.txt b/vendor/mustache/mustache/test/fixtures/examples/complex/complex.txt new file mode 100644 index 00000000..facee6df --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/complex/complex.txt @@ -0,0 +1,6 @@ +

Colors

+ diff --git a/vendor/mustache/mustache/test/fixtures/examples/delimiters/Delimiters.php b/vendor/mustache/mustache/test/fixtures/examples/delimiters/Delimiters.php new file mode 100644 index 00000000..235a0886 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/delimiters/Delimiters.php @@ -0,0 +1,25 @@ + 'And it worked the second time.'), + array('item' => 'As well as the third.'), + ); + } + + public $final = 'Then, surprisingly, it worked the final time.'; +} diff --git a/vendor/mustache/mustache/test/fixtures/examples/delimiters/delimiters.mustache b/vendor/mustache/mustache/test/fixtures/examples/delimiters/delimiters.mustache new file mode 100644 index 00000000..e9b0332b --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/delimiters/delimiters.mustache @@ -0,0 +1,8 @@ +{{=<% %>=}} +* <% start %> +<%=| |=%> +|# middle | +* | item | +|/ middle | +|={{ }}=| +* {{ final }} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/delimiters/delimiters.txt b/vendor/mustache/mustache/test/fixtures/examples/delimiters/delimiters.txt new file mode 100644 index 00000000..e6b2d7af --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/delimiters/delimiters.txt @@ -0,0 +1,4 @@ +* It worked the first time. +* And it worked the second time. +* As well as the third. +* Then, surprisingly, it worked the final time. \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/dot_notation/DotNotation.php b/vendor/mustache/mustache/test/fixtures/examples/dot_notation/DotNotation.php new file mode 100644 index 00000000..eadbf61d --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/dot_notation/DotNotation.php @@ -0,0 +1,24 @@ + array('first' => 'Chris', 'last' => 'Firescythe'), + 'age' => 24, + 'hometown' => array( + 'city' => 'Cincinnati', + 'state' => 'OH', + ), + ); + + public $normal = 'Normal'; +} diff --git a/vendor/mustache/mustache/test/fixtures/examples/dot_notation/dot_notation.mustache b/vendor/mustache/mustache/test/fixtures/examples/dot_notation/dot_notation.mustache new file mode 100644 index 00000000..0566867b --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/dot_notation/dot_notation.mustache @@ -0,0 +1,4 @@ +* {{person.name.first}} {{person.name.last}} +* {{person.age}} +* {{person.hometown.city}}, {{person.hometown.state}} +* {{normal}} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/dot_notation/dot_notation.txt b/vendor/mustache/mustache/test/fixtures/examples/dot_notation/dot_notation.txt new file mode 100644 index 00000000..f8cf1fa1 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/dot_notation/dot_notation.txt @@ -0,0 +1,4 @@ +* Chris Firescythe +* 24 +* Cincinnati, OH +* Normal \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/double_section/DoubleSection.php b/vendor/mustache/mustache/test/fixtures/examples/double_section/DoubleSection.php new file mode 100644 index 00000000..1b3f6b66 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/double_section/DoubleSection.php @@ -0,0 +1,20 @@ + "Shark"'; +} diff --git a/vendor/mustache/mustache/test/fixtures/examples/escaped/escaped.mustache b/vendor/mustache/mustache/test/fixtures/examples/escaped/escaped.mustache new file mode 100644 index 00000000..8be4ccb6 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/escaped/escaped.mustache @@ -0,0 +1 @@ +

{{title}}

\ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/escaped/escaped.txt b/vendor/mustache/mustache/test/fixtures/examples/escaped/escaped.txt new file mode 100644 index 00000000..6ba3657e --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/escaped/escaped.txt @@ -0,0 +1 @@ +

"Bear" > "Shark"

\ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/filters/Filters.php b/vendor/mustache/mustache/test/fixtures/examples/filters/Filters.php new file mode 100644 index 00000000..eb6e3b77 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/filters/Filters.php @@ -0,0 +1,97 @@ + 'Alabama', + 'ak' => 'Alaska', + 'az' => 'Arizona', + 'ar' => 'Arkansas', + 'ca' => 'California', + 'co' => 'Colorado', + 'ct' => 'Connecticut', + 'de' => 'Delaware', + 'fl' => 'Florida', + 'ga' => 'Georgia', + 'hi' => 'Hawaii', + 'id' => 'Idaho', + 'il' => 'Illinois', + 'in' => 'Indiana', + 'ia' => 'Iowa', + 'ks' => 'Kansas', + 'ky' => 'Kentucky', + 'la' => 'Louisiana', + 'me' => 'Maine', + 'md' => 'Maryland', + 'ma' => 'Massachusetts', + 'mi' => 'Michigan', + 'mn' => 'Minnesota', + 'ms' => 'Mississippi', + 'mo' => 'Missouri', + 'mt' => 'Montana', + 'ne' => 'Nebraska', + 'nv' => 'Nevada', + 'nh' => 'New Hampshire', + 'nj' => 'New Jersey', + 'nm' => 'New Mexico', + 'ny' => 'New York', + 'nc' => 'North Carolina', + 'nd' => 'North Dakota', + 'oh' => 'Ohio', + 'ok' => 'Oklahoma', + 'or' => 'Oregon', + 'pa' => 'Pennsylvania', + 'ri' => 'Rhode Island', + 'sc' => 'South Carolina', + 'sd' => 'South Dakota', + 'tn' => 'Tennessee', + 'tx' => 'Texas', + 'ut' => 'Utah', + 'vt' => 'Vermont', + 'va' => 'Virginia', + 'wa' => 'Washington', + 'wv' => 'West Virginia', + 'wi' => 'Wisconsin', + 'wy' => 'Wyoming', + ); + + // The next few functions are ugly, because they have to work in PHP 5.2... + // for everyone who doesn't have to support 5.2, please, for the love, make + // your ViewModel return closures rather than `array($this, '...')` + // + // :) + + public function upcase() + { + return array($this, '_upcase'); + } + + public function _upcase($val) + { + return strtoupper($val); + } + + public function eachPair() + { + return array($this, '_eachPair'); + } + + public function _eachPair($val) + { + $ret = array(); + foreach ($val as $key => $value) { + array_push($ret, compact('key', 'value')); + } + + return $ret; + } +} diff --git a/vendor/mustache/mustache/test/fixtures/examples/filters/filters.mustache b/vendor/mustache/mustache/test/fixtures/examples/filters/filters.mustache new file mode 100644 index 00000000..50f14653 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/filters/filters.mustache @@ -0,0 +1,4 @@ +{{%FILTERS}} +{{# states | eachPair }} +{{ key | upcase }}: {{ value }} +{{/ states }} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/filters/filters.txt b/vendor/mustache/mustache/test/fixtures/examples/filters/filters.txt new file mode 100644 index 00000000..67466fd5 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/filters/filters.txt @@ -0,0 +1,50 @@ +AL: Alabama +AK: Alaska +AZ: Arizona +AR: Arkansas +CA: California +CO: Colorado +CT: Connecticut +DE: Delaware +FL: Florida +GA: Georgia +HI: Hawaii +ID: Idaho +IL: Illinois +IN: Indiana +IA: Iowa +KS: Kansas +KY: Kentucky +LA: Louisiana +ME: Maine +MD: Maryland +MA: Massachusetts +MI: Michigan +MN: Minnesota +MS: Mississippi +MO: Missouri +MT: Montana +NE: Nebraska +NV: Nevada +NH: New Hampshire +NJ: New Jersey +NM: New Mexico +NY: New York +NC: North Carolina +ND: North Dakota +OH: Ohio +OK: Oklahoma +OR: Oregon +PA: Pennsylvania +RI: Rhode Island +SC: South Carolina +SD: South Dakota +TN: Tennessee +TX: Texas +UT: Utah +VT: Vermont +VA: Virginia +WA: Washington +WV: West Virginia +WI: Wisconsin +WY: Wyoming diff --git a/vendor/mustache/mustache/test/fixtures/examples/grand_parent_context/GrandParentContext.php b/vendor/mustache/mustache/test/fixtures/examples/grand_parent_context/GrandParentContext.php new file mode 100644 index 00000000..2ee0e428 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/grand_parent_context/GrandParentContext.php @@ -0,0 +1,33 @@ +parent_contexts[] = array('parent_id' => 'parent1', 'child_contexts' => array( + array('child_id' => 'parent1-child1'), + array('child_id' => 'parent1-child2'), + )); + + $parent2 = new stdClass(); + $parent2->parent_id = 'parent2'; + $parent2->child_contexts = array( + array('child_id' => 'parent2-child1'), + array('child_id' => 'parent2-child2'), + ); + + $this->parent_contexts[] = $parent2; + } +} diff --git a/vendor/mustache/mustache/test/fixtures/examples/grand_parent_context/grand_parent_context.mustache b/vendor/mustache/mustache/test/fixtures/examples/grand_parent_context/grand_parent_context.mustache new file mode 100644 index 00000000..6d03ddf6 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/grand_parent_context/grand_parent_context.mustache @@ -0,0 +1,7 @@ +{{grand_parent_id}} +{{#parent_contexts}} + {{parent_id}} ({{grand_parent_id}}) + {{#child_contexts}} + {{child_id}} ({{parent_id}} << {{grand_parent_id}}) + {{/child_contexts}} +{{/parent_contexts}} diff --git a/vendor/mustache/mustache/test/fixtures/examples/grand_parent_context/grand_parent_context.txt b/vendor/mustache/mustache/test/fixtures/examples/grand_parent_context/grand_parent_context.txt new file mode 100644 index 00000000..2687f849 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/grand_parent_context/grand_parent_context.txt @@ -0,0 +1,7 @@ +grand_parent1 + parent1 (grand_parent1) + parent1-child1 (parent1 << grand_parent1) + parent1-child2 (parent1 << grand_parent1) + parent2 (grand_parent1) + parent2-child1 (parent2 << grand_parent1) + parent2-child2 (parent2 << grand_parent1) diff --git a/vendor/mustache/mustache/test/fixtures/examples/i18n/I18n.php b/vendor/mustache/mustache/test/fixtures/examples/i18n/I18n.php new file mode 100644 index 00000000..c36bf709 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/i18n/I18n.php @@ -0,0 +1,30 @@ + 'Hola.', + 'My name is {{ name }}.' => 'Me llamo {{ name }}.', + ); + + public static function __trans($text) + { + return isset(self::$dictionary[$text]) ? self::$dictionary[$text] : $text; + } +} diff --git a/vendor/mustache/mustache/test/fixtures/examples/i18n/i18n.mustache b/vendor/mustache/mustache/test/fixtures/examples/i18n/i18n.mustache new file mode 100644 index 00000000..eef169b4 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/i18n/i18n.mustache @@ -0,0 +1 @@ +{{#__}}Hello.{{/__}} {{#__}}My name is {{ name }}.{{/__}} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/i18n/i18n.txt b/vendor/mustache/mustache/test/fixtures/examples/i18n/i18n.txt new file mode 100644 index 00000000..650a71ac --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/i18n/i18n.txt @@ -0,0 +1 @@ +Hola. Me llamo Bob. \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/implicit_iterator/ImplicitIterator.php b/vendor/mustache/mustache/test/fixtures/examples/implicit_iterator/ImplicitIterator.php new file mode 100644 index 00000000..074f8f49 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/implicit_iterator/ImplicitIterator.php @@ -0,0 +1,15 @@ +{{name}} +{{/repo}} +{{^repo}} + No repos :( +{{/repo}} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/inverted_section/inverted_section.txt b/vendor/mustache/mustache/test/fixtures/examples/inverted_section/inverted_section.txt new file mode 100644 index 00000000..6ba5a990 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/inverted_section/inverted_section.txt @@ -0,0 +1 @@ + No repos :( diff --git a/vendor/mustache/mustache/test/fixtures/examples/nested_partials/NestedPartials.php b/vendor/mustache/mustache/test/fixtures/examples/nested_partials/NestedPartials.php new file mode 100644 index 00000000..a2a2bb16 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/nested_partials/NestedPartials.php @@ -0,0 +1,15 @@ + + {{> second }} + \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/nested_partials/nested_partials.txt b/vendor/mustache/mustache/test/fixtures/examples/nested_partials/nested_partials.txt new file mode 100644 index 00000000..62776f97 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/nested_partials/nested_partials.txt @@ -0,0 +1,7 @@ + + + + FOURTH! + + + \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/nested_partials/partials/fourth.mustache b/vendor/mustache/mustache/test/fixtures/examples/nested_partials/partials/fourth.mustache new file mode 100644 index 00000000..727676fe --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/nested_partials/partials/fourth.mustache @@ -0,0 +1 @@ +{{ val }} diff --git a/vendor/mustache/mustache/test/fixtures/examples/nested_partials/partials/second.mustache b/vendor/mustache/mustache/test/fixtures/examples/nested_partials/partials/second.mustache new file mode 100644 index 00000000..83f33cf4 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/nested_partials/partials/second.mustache @@ -0,0 +1,3 @@ + + {{> third }} + diff --git a/vendor/mustache/mustache/test/fixtures/examples/nested_partials/partials/third.mustache b/vendor/mustache/mustache/test/fixtures/examples/nested_partials/partials/third.mustache new file mode 100644 index 00000000..f33301a6 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/nested_partials/partials/third.mustache @@ -0,0 +1,3 @@ + + {{> fourth }} + diff --git a/vendor/mustache/mustache/test/fixtures/examples/partials/Partials.php b/vendor/mustache/mustache/test/fixtures/examples/partials/Partials.php new file mode 100644 index 00000000..e91dc681 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/partials/Partials.php @@ -0,0 +1,19 @@ + 'Page Title', + 'subtitle' => 'Page Subtitle', + 'content' => 'Lorem ipsum dolor sit amet.', + ); +} diff --git a/vendor/mustache/mustache/test/fixtures/examples/partials/partials.mustache b/vendor/mustache/mustache/test/fixtures/examples/partials/partials.mustache new file mode 100644 index 00000000..54cf1c52 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/partials/partials.mustache @@ -0,0 +1,7 @@ +
+ {{> header }} + +
+ {{ page.content }} +
+
\ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/partials/partials.txt b/vendor/mustache/mustache/test/fixtures/examples/partials/partials.txt new file mode 100644 index 00000000..f8e45ce3 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/partials/partials.txt @@ -0,0 +1,8 @@ +
+

Page Title

+

Page Subtitle

+ +
+ Lorem ipsum dolor sit amet. +
+
\ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/partials/partials/header.mustache b/vendor/mustache/mustache/test/fixtures/examples/partials/partials/header.mustache new file mode 100644 index 00000000..88d567b2 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/partials/partials/header.mustache @@ -0,0 +1,4 @@ +{{# page }} +

{{ title }}

+

{{ subtitle }}

+{{/ page }} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/recursive_partials/RecursivePartials.php b/vendor/mustache/mustache/test/fixtures/examples/recursive_partials/RecursivePartials.php new file mode 100644 index 00000000..15b6973d --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/recursive_partials/RecursivePartials.php @@ -0,0 +1,22 @@ + 'Dan', + 'child' => array( + 'name' => 'Justin', + 'child' => false, + ), + ); +} diff --git a/vendor/mustache/mustache/test/fixtures/examples/recursive_partials/partials/child.mustache b/vendor/mustache/mustache/test/fixtures/examples/recursive_partials/partials/child.mustache new file mode 100644 index 00000000..12829415 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/recursive_partials/partials/child.mustache @@ -0,0 +1 @@ + > {{ name }}{{#child}}{{>child}}{{/child}} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/recursive_partials/recursive_partials.mustache b/vendor/mustache/mustache/test/fixtures/examples/recursive_partials/recursive_partials.mustache new file mode 100644 index 00000000..0bc5d03d --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/recursive_partials/recursive_partials.mustache @@ -0,0 +1 @@ +{{name}}{{#child}}{{>child}}{{/child}} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/recursive_partials/recursive_partials.txt b/vendor/mustache/mustache/test/fixtures/examples/recursive_partials/recursive_partials.txt new file mode 100644 index 00000000..681cdef6 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/recursive_partials/recursive_partials.txt @@ -0,0 +1 @@ +George > Dan > Justin \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/section_iterator_objects/SectionIteratorObjects.php b/vendor/mustache/mustache/test/fixtures/examples/section_iterator_objects/SectionIteratorObjects.php new file mode 100644 index 00000000..0dc793c2 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/section_iterator_objects/SectionIteratorObjects.php @@ -0,0 +1,27 @@ + 'And it worked the second time.'), + array('item' => 'As well as the third.'), + ); + + public function middle() + { + return new ArrayIterator($this->_data); + } + + public $final = 'Then, surprisingly, it worked the final time.'; +} diff --git a/vendor/mustache/mustache/test/fixtures/examples/section_iterator_objects/section_iterator_objects.mustache b/vendor/mustache/mustache/test/fixtures/examples/section_iterator_objects/section_iterator_objects.mustache new file mode 100644 index 00000000..44dfce48 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/section_iterator_objects/section_iterator_objects.mustache @@ -0,0 +1,5 @@ +* {{ start }} +{{# middle }} +* {{ item }} +{{/ middle }} +* {{ final }} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/section_iterator_objects/section_iterator_objects.txt b/vendor/mustache/mustache/test/fixtures/examples/section_iterator_objects/section_iterator_objects.txt new file mode 100644 index 00000000..e6b2d7af --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/section_iterator_objects/section_iterator_objects.txt @@ -0,0 +1,4 @@ +* It worked the first time. +* And it worked the second time. +* As well as the third. +* Then, surprisingly, it worked the final time. \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/section_magic_objects/SectionMagicObjects.php b/vendor/mustache/mustache/test/fixtures/examples/section_magic_objects/SectionMagicObjects.php new file mode 100644 index 00000000..0fcb3b4b --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/section_magic_objects/SectionMagicObjects.php @@ -0,0 +1,40 @@ + 'And it worked the second time.', + 'bar' => 'As well as the third.', + ); + + public function __get($key) + { + return isset($this->_data[$key]) ? $this->_data[$key] : null; + } + + public function __isset($key) + { + return isset($this->_data[$key]); + } +} diff --git a/vendor/mustache/mustache/test/fixtures/examples/section_magic_objects/section_magic_objects.mustache b/vendor/mustache/mustache/test/fixtures/examples/section_magic_objects/section_magic_objects.mustache new file mode 100644 index 00000000..91196085 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/section_magic_objects/section_magic_objects.mustache @@ -0,0 +1,6 @@ +* {{ start }} +{{# middle }} +* {{ foo }} +* {{ bar }} +{{/ middle }} +* {{ final }} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/section_magic_objects/section_magic_objects.txt b/vendor/mustache/mustache/test/fixtures/examples/section_magic_objects/section_magic_objects.txt new file mode 100644 index 00000000..e6b2d7af --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/section_magic_objects/section_magic_objects.txt @@ -0,0 +1,4 @@ +* It worked the first time. +* And it worked the second time. +* As well as the third. +* Then, surprisingly, it worked the final time. \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/section_objects/SectionObjects.php b/vendor/mustache/mustache/test/fixtures/examples/section_objects/SectionObjects.php new file mode 100644 index 00000000..913c3ebd --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/section_objects/SectionObjects.php @@ -0,0 +1,28 @@ + 'And it worked the second time.'), + array('item' => 'As well as the third.'), + ); + } + + public $final = 'Then, surprisingly, it worked the final time.'; +} diff --git a/vendor/mustache/mustache/test/fixtures/examples/sections/sections.mustache b/vendor/mustache/mustache/test/fixtures/examples/sections/sections.mustache new file mode 100644 index 00000000..44dfce48 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/sections/sections.mustache @@ -0,0 +1,5 @@ +* {{ start }} +{{# middle }} +* {{ item }} +{{/ middle }} +* {{ final }} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/sections/sections.txt b/vendor/mustache/mustache/test/fixtures/examples/sections/sections.txt new file mode 100644 index 00000000..e6b2d7af --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/sections/sections.txt @@ -0,0 +1,4 @@ +* It worked the first time. +* And it worked the second time. +* As well as the third. +* Then, surprisingly, it worked the final time. \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/sections_nested/SectionsNested.php b/vendor/mustache/mustache/test/fixtures/examples/sections_nested/SectionsNested.php new file mode 100644 index 00000000..43657c3d --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/sections_nested/SectionsNested.php @@ -0,0 +1,44 @@ + 'Von Kaiser', + 'enemies' => array( + array('name' => 'Super Macho Man'), + array('name' => 'Piston Honda'), + array('name' => 'Mr. Sandman'), + ), + ), + array( + 'name' => 'Mike Tyson', + 'enemies' => array( + array('name' => 'Soda Popinski'), + array('name' => 'King Hippo'), + array('name' => 'Great Tiger'), + array('name' => 'Glass Joe'), + ), + ), + array( + 'name' => 'Don Flamenco', + 'enemies' => array( + array('name' => 'Bald Bull'), + ), + ), + ); + } +} diff --git a/vendor/mustache/mustache/test/fixtures/examples/sections_nested/sections_nested.mustache b/vendor/mustache/mustache/test/fixtures/examples/sections_nested/sections_nested.mustache new file mode 100644 index 00000000..9f8007db --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/sections_nested/sections_nested.mustache @@ -0,0 +1,7 @@ +Enemies of {{ name }}: +{{# enemies }} +{{ name }} ... who also has enemies: +{{# enemies }} +--> {{ name }} +{{/ enemies }} +{{/ enemies }} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/sections_nested/sections_nested.txt b/vendor/mustache/mustache/test/fixtures/examples/sections_nested/sections_nested.txt new file mode 100644 index 00000000..72c44d06 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/sections_nested/sections_nested.txt @@ -0,0 +1,12 @@ +Enemies of Little Mac: +Von Kaiser ... who also has enemies: +--> Super Macho Man +--> Piston Honda +--> Mr. Sandman +Mike Tyson ... who also has enemies: +--> Soda Popinski +--> King Hippo +--> Great Tiger +--> Glass Joe +Don Flamenco ... who also has enemies: +--> Bald Bull diff --git a/vendor/mustache/mustache/test/fixtures/examples/simple/Simple.php b/vendor/mustache/mustache/test/fixtures/examples/simple/Simple.php new file mode 100644 index 00000000..a5492e8f --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/simple/Simple.php @@ -0,0 +1,23 @@ +value - ($this->value * 0.4); + } + + public $in_ca = true; +} diff --git a/vendor/mustache/mustache/test/fixtures/examples/simple/simple.mustache b/vendor/mustache/mustache/test/fixtures/examples/simple/simple.mustache new file mode 100644 index 00000000..03df2068 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/simple/simple.mustache @@ -0,0 +1,5 @@ +Hello {{name}} +You have just won ${{value}}! +{{#in_ca}} +Well, ${{ taxed_value }}, after taxes. +{{/in_ca}} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/simple/simple.txt b/vendor/mustache/mustache/test/fixtures/examples/simple/simple.txt new file mode 100644 index 00000000..5d75d656 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/simple/simple.txt @@ -0,0 +1,3 @@ +Hello Chris +You have just won $10000! +Well, $6000, after taxes. diff --git a/vendor/mustache/mustache/test/fixtures/examples/unescaped/Unescaped.php b/vendor/mustache/mustache/test/fixtures/examples/unescaped/Unescaped.php new file mode 100644 index 00000000..ea85f885 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/unescaped/Unescaped.php @@ -0,0 +1,15 @@ + Shark'; +} diff --git a/vendor/mustache/mustache/test/fixtures/examples/unescaped/unescaped.mustache b/vendor/mustache/mustache/test/fixtures/examples/unescaped/unescaped.mustache new file mode 100644 index 00000000..9982708a --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/unescaped/unescaped.mustache @@ -0,0 +1 @@ +

{{{title}}}

\ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/unescaped/unescaped.txt b/vendor/mustache/mustache/test/fixtures/examples/unescaped/unescaped.txt new file mode 100644 index 00000000..01fa4048 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/unescaped/unescaped.txt @@ -0,0 +1 @@ +

Bear > Shark

\ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/utf8/UTF8.php b/vendor/mustache/mustache/test/fixtures/examples/utf8/UTF8.php new file mode 100644 index 00000000..c53fec9f --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/utf8/UTF8.php @@ -0,0 +1,15 @@ +中文 {{test}} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/utf8/utf8.txt b/vendor/mustache/mustache/test/fixtures/examples/utf8/utf8.txt new file mode 100644 index 00000000..bf17971b --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/utf8/utf8.txt @@ -0,0 +1 @@ +

中文 中文又来啦

\ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/utf8_unescaped/UTF8Unescaped.php b/vendor/mustache/mustache/test/fixtures/examples/utf8_unescaped/UTF8Unescaped.php new file mode 100644 index 00000000..67f93666 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/utf8_unescaped/UTF8Unescaped.php @@ -0,0 +1,15 @@ +中文 {{{test}}} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/utf8_unescaped/utf8_unescaped.txt b/vendor/mustache/mustache/test/fixtures/examples/utf8_unescaped/utf8_unescaped.txt new file mode 100644 index 00000000..bf17971b --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/utf8_unescaped/utf8_unescaped.txt @@ -0,0 +1 @@ +

中文 中文又来啦

\ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/whitespace/Whitespace.php b/vendor/mustache/mustache/test/fixtures/examples/whitespace/Whitespace.php new file mode 100644 index 00000000..57a3267f --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/whitespace/Whitespace.php @@ -0,0 +1,43 @@ + tag }}` and `{{> tag}}` and `{{>tag}}` should all be equivalent. + */ +class Whitespace +{ + public $foo = 'alpha'; + + public $bar = 'beta'; + + public function baz() + { + return 'gamma'; + } + + public function qux() + { + return array( + array('key with space' => 'A'), + array('key with space' => 'B'), + array('key with space' => 'C'), + array('key with space' => 'D'), + array('key with space' => 'E'), + array('key with space' => 'F'), + array('key with space' => 'G'), + ); + } +} diff --git a/vendor/mustache/mustache/test/fixtures/examples/whitespace/partials/alphabet.mustache b/vendor/mustache/mustache/test/fixtures/examples/whitespace/partials/alphabet.mustache new file mode 100644 index 00000000..d281c41b --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/whitespace/partials/alphabet.mustache @@ -0,0 +1 @@ + * {{.}} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/whitespace/whitespace.mustache b/vendor/mustache/mustache/test/fixtures/examples/whitespace/whitespace.mustache new file mode 100644 index 00000000..0b3ba000 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/whitespace/whitespace.mustache @@ -0,0 +1,10 @@ +{{^ inverted section test }} +These are some things: +{{/inverted section test }} +* {{ foo }} +* {{ bar}} +* {{ baz }} +{{# qux }} +* {{ key with space }} +{{/ qux }} +{{#qux}}.{{/qux}} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/whitespace/whitespace.txt b/vendor/mustache/mustache/test/fixtures/examples/whitespace/whitespace.txt new file mode 100644 index 00000000..5226c698 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/examples/whitespace/whitespace.txt @@ -0,0 +1,12 @@ +These are some things: +* alpha +* beta +* gamma +* A +* B +* C +* D +* E +* F +* G +....... \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/templates/alpha.ms b/vendor/mustache/mustache/test/fixtures/templates/alpha.ms new file mode 100644 index 00000000..3845830e --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/templates/alpha.ms @@ -0,0 +1 @@ +alpha contents \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/templates/beta.ms b/vendor/mustache/mustache/test/fixtures/templates/beta.ms new file mode 100644 index 00000000..a083dfe8 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/templates/beta.ms @@ -0,0 +1 @@ +beta contents \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/templates/one.mustache b/vendor/mustache/mustache/test/fixtures/templates/one.mustache new file mode 100644 index 00000000..f83ad095 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/templates/one.mustache @@ -0,0 +1 @@ +one contents \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/templates/two.mustache b/vendor/mustache/mustache/test/fixtures/templates/two.mustache new file mode 100644 index 00000000..dacc40e2 --- /dev/null +++ b/vendor/mustache/mustache/test/fixtures/templates/two.mustache @@ -0,0 +1 @@ +two contents \ No newline at end of file diff --git a/vendor/scribu/lib-posts-to-posts/.gitignore b/vendor/scribu/lib-posts-to-posts/.gitignore new file mode 100644 index 00000000..d1502b08 --- /dev/null +++ b/vendor/scribu/lib-posts-to-posts/.gitignore @@ -0,0 +1,2 @@ +vendor/ +composer.lock diff --git a/vendor/scribu/lib-posts-to-posts/side-post.php b/vendor/scribu/lib-posts-to-posts/side-post.php index c84a3f97..4b26d1ff 100644 --- a/vendor/scribu/lib-posts-to-posts/side-post.php +++ b/vendor/scribu/lib-posts-to-posts/side-post.php @@ -22,7 +22,7 @@ private function get_ptype() { $ptype_object = get_post_type_object( $ptype ); if ( !$ptype_object ) { - throw new P2P_Exception( "Can't find $ptype." ); + throw new P2P_Exception( "Can't find post type $ptype." ); } return $ptype_object; diff --git a/vendor/scribu/scb-framework/.gitignore b/vendor/scribu/scb-framework/.gitignore new file mode 100644 index 00000000..90ec22be --- /dev/null +++ b/vendor/scribu/scb-framework/.gitignore @@ -0,0 +1 @@ +.svn diff --git a/vendor/scribu/scb-framework/AdminPage.php b/vendor/scribu/scb-framework/AdminPage.php index 5539cc66..7eb4c3b2 100644 --- a/vendor/scribu/scb-framework/AdminPage.php +++ b/vendor/scribu/scb-framework/AdminPage.php @@ -135,6 +135,7 @@ public function __construct( $file = false, $options = null ) { } add_action( 'admin_menu', array( $this, 'page_init' ), $this->args['admin_action_priority'] ); + add_filter( 'contextual_help', array( $this, '_contextual_help' ), 10, 2 ); if ( $file ) { $this->file = $file; @@ -508,7 +509,6 @@ private function check_args() { 'toplevel' => '', 'position' => null, 'icon_url' => '', - 'screen_icon' => '', 'parent' => 'options-general.php', 'capability' => 'manage_options', 'menu_title' => $this->args['page_title'], @@ -538,7 +538,6 @@ private function check_args() { * @param string|object $screen * * @return string - * @deprecated 1.6.6 Not used */ public function _contextual_help( $help, $screen ) { if ( is_object( $screen ) ) { @@ -580,4 +579,3 @@ public function _action_link( $links ) { return $links; } } - diff --git a/vendor/scribu/scb-framework/Forms.php b/vendor/scribu/scb-framework/Forms.php index 241c4857..43c4cd1a 100644 --- a/vendor/scribu/scb-framework/Forms.php +++ b/vendor/scribu/scb-framework/Forms.php @@ -606,6 +606,10 @@ protected static function _input_gen( $args ) { * @return string */ protected static function add_label( $input, $desc, $desc_pos ) { + if ( empty( $desc ) ) { + return $input; + } + return html( 'label', self::add_desc( $input, $desc, $desc_pos ) ) . "\n"; } diff --git a/vendor/scribu/scb-framework/load.php b/vendor/scribu/scb-framework/load.php index df20f542..56c5e643 100644 --- a/vendor/scribu/scb-framework/load.php +++ b/vendor/scribu/scb-framework/load.php @@ -1,6 +1,6 @@ Date: Thu, 9 Sep 2021 14:23:39 +0200 Subject: [PATCH 2/5] Update readme. --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 02c9e95c..22fc9a8d 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Tags: connections, custom post types, relationships, many-to-many, users Requires at least: 3.9 Requires PHP: 5.6 Tested up to: 5.4 -Stable tag: 1.6.6 +Stable tag: 1.6.7 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html From 6b3c4861e79e5d713036ed71668dc9ca745ba1ae Mon Sep 17 00:00:00 2001 From: Jeffrey van Rossum Date: Mon, 28 Feb 2022 21:05:40 +0100 Subject: [PATCH 3/5] Alter vcs url for lib. --- composer.json | 2 +- vendor/mustache/mustache/.gitattributes | 8 + vendor/mustache/mustache/.gitignore | 4 - vendor/mustache/mustache/.gitmodules | 6 - vendor/mustache/mustache/.php_cs | 26 - vendor/mustache/mustache/.styleci.yml | 13 - vendor/mustache/mustache/.travis.yml | 31 - vendor/mustache/mustache/CONTRIBUTING.md | 35 -- vendor/mustache/mustache/README.md | 9 +- vendor/mustache/mustache/phpunit.xml.dist | 17 - .../mustache/mustache/src/Mustache/Cache.php | 7 + .../src/Mustache/Cache/AbstractCache.php | 2 +- .../mustache/src/Mustache/Compiler.php | 13 +- .../mustache/mustache/src/Mustache/Engine.php | 4 +- .../src/Mustache/Source/FilesystemSource.php | 4 +- .../mustache/src/Mustache/Tokenizer.php | 17 +- .../test/Mustache/Test/AutoloaderTest.php | 51 -- .../Mustache/Test/Cache/AbstractCacheTest.php | 44 -- .../Test/Cache/FilesystemCacheTest.php | 36 -- .../test/Mustache/Test/CompilerTest.php | 154 ----- .../test/Mustache/Test/ContextTest.php | 282 --------- .../test/Mustache/Test/EngineTest.php | 397 ------------- .../Test/Exception/SyntaxExceptionTest.php | 39 -- .../Exception/UnknownFilterExceptionTest.php | 44 -- .../Exception/UnknownHelperExceptionTest.php | 43 -- .../UnknownTemplateExceptionTest.php | 43 -- .../Functional/ClosureQuirksTest.php | 32 -- .../Test/FiveThree/Functional/EngineTest.php | 50 -- .../Test/FiveThree/Functional/FiltersTest.php | 187 ------ .../Functional/HigherOrderSectionsTest.php | 77 --- .../FiveThree/Functional/LambdaHelperTest.php | 67 --- .../FiveThree/Functional/MustacheSpecTest.php | 68 --- .../Functional/PartialLambdaIndentTest.php | 94 --- .../Functional/StrictCallablesTest.php | 135 ----- .../Mustache/Test/Functional/CallTest.php | 40 -- .../Mustache/Test/Functional/ExamplesTest.php | 142 ----- .../Functional/HigherOrderSectionsTest.php | 177 ------ .../Test/Functional/InheritanceTest.php | 543 ------------------ .../Test/Functional/MustacheInjectionTest.php | 83 --- .../Test/Functional/MustacheSpecTest.php | 121 ---- .../Functional/NestedPartialIndentTest.php | 45 -- .../Test/Functional/ObjectSectionTest.php | 110 ---- .../test/Mustache/Test/FunctionalTestCase.php | 47 -- .../Mustache/Test/HelperCollectionTest.php | 163 ------ .../Mustache/Test/Loader/ArrayLoaderTest.php | 52 -- .../Test/Loader/CascadingLoaderTest.php | 40 -- .../Test/Loader/FilesystemLoaderTest.php | 80 --- .../Mustache/Test/Loader/InlineLoaderTest.php | 56 -- .../Loader/ProductionFilesystemLoaderTest.php | 103 ---- .../Mustache/Test/Loader/StringLoaderTest.php | 25 - .../Test/Logger/AbstractLoggerTest.php | 60 -- .../Mustache/Test/Logger/StreamLoggerTest.php | 209 ------- .../test/Mustache/Test/ParserTest.php | 425 -------------- .../Test/Source/FilesystemSourceTest.php | 25 - .../test/Mustache/Test/SpecTestCase.php | 67 --- .../test/Mustache/Test/TemplateTest.php | 55 -- .../test/Mustache/Test/TokenizerTest.php | 306 ---------- vendor/mustache/mustache/test/bootstrap.php | 91 --- .../test/fixtures/autoloader/Mustache/Bar.php | 15 - .../test/fixtures/autoloader/Mustache/Foo.php | 15 - .../fixtures/autoloader/NonMustacheClass.php | 15 - .../AnchoredDotNotation.php | 55 -- .../anchored_dot_notation.mustache | 4 - .../anchored_dot_notation.txt | 11 - .../partials/genre.mustache | 5 - .../test/fixtures/examples/blocks/Blocks.php | 15 - .../fixtures/examples/blocks/blocks.mustache | 4 - .../test/fixtures/examples/blocks/blocks.txt | 3 - .../examples/blocks/partials/parent.mustache | 4 - .../examples/child_context/ChildContext.php | 23 - .../child_context/child_context.mustache | 2 - .../examples/child_context/child_context.txt | 2 - .../fixtures/examples/comments/Comments.php | 18 - .../examples/comments/comments.mustache | 1 - .../fixtures/examples/comments/comments.txt | 1 - .../examples/complex/complex.mustache | 16 - .../fixtures/examples/complex/complex.php | 31 - .../fixtures/examples/complex/complex.txt | 6 - .../examples/delimiters/Delimiters.php | 25 - .../examples/delimiters/delimiters.mustache | 8 - .../examples/delimiters/delimiters.txt | 4 - .../examples/dot_notation/DotNotation.php | 24 - .../dot_notation/dot_notation.mustache | 4 - .../examples/dot_notation/dot_notation.txt | 4 - .../examples/double_section/DoubleSection.php | 20 - .../double_section/double_section.mustache | 7 - .../double_section/double_section.txt | 3 - .../fixtures/examples/escaped/Escaped.php | 15 - .../examples/escaped/escaped.mustache | 1 - .../fixtures/examples/escaped/escaped.txt | 1 - .../fixtures/examples/filters/Filters.php | 97 ---- .../examples/filters/filters.mustache | 4 - .../fixtures/examples/filters/filters.txt | 50 -- .../GrandParentContext.php | 33 -- .../grand_parent_context.mustache | 7 - .../grand_parent_context.txt | 7 - .../test/fixtures/examples/i18n/I18n.php | 30 - .../test/fixtures/examples/i18n/i18n.mustache | 1 - .../test/fixtures/examples/i18n/i18n.txt | 1 - .../implicit_iterator/ImplicitIterator.php | 15 - .../implicit_iterator.mustache | 3 - .../implicit_iterator/implicit_iterator.txt | 5 - .../InvertedDoubleSection.php | 16 - .../inverted_double_section.mustache | 7 - .../inverted_double_section.txt | 3 - .../inverted_section/InvertedSection.php | 15 - .../inverted_section.mustache | 6 - .../inverted_section/inverted_section.txt | 1 - .../nested_partials/NestedPartials.php | 15 - .../nested_partials/nested_partials.mustache | 3 - .../nested_partials/nested_partials.txt | 7 - .../nested_partials/partials/fourth.mustache | 1 - .../nested_partials/partials/second.mustache | 3 - .../nested_partials/partials/third.mustache | 3 - .../fixtures/examples/partials/Partials.php | 19 - .../examples/partials/partials.mustache | 7 - .../fixtures/examples/partials/partials.txt | 8 - .../partials/partials/header.mustache | 4 - .../recursive_partials/RecursivePartials.php | 22 - .../partials/child.mustache | 1 - .../recursive_partials.mustache | 1 - .../recursive_partials/recursive_partials.txt | 1 - .../SectionIteratorObjects.php | 27 - .../section_iterator_objects.mustache | 5 - .../section_iterator_objects.txt | 4 - .../SectionMagicObjects.php | 40 -- .../section_magic_objects.mustache | 6 - .../section_magic_objects.txt | 4 - .../section_objects/SectionObjects.php | 28 - .../section_objects/section_objects.mustache | 6 - .../section_objects/section_objects.txt | 4 - .../fixtures/examples/sections/Sections.php | 25 - .../examples/sections/sections.mustache | 5 - .../fixtures/examples/sections/sections.txt | 4 - .../sections_nested/SectionsNested.php | 44 -- .../sections_nested/sections_nested.mustache | 7 - .../sections_nested/sections_nested.txt | 12 - .../test/fixtures/examples/simple/Simple.php | 23 - .../fixtures/examples/simple/simple.mustache | 5 - .../test/fixtures/examples/simple/simple.txt | 3 - .../fixtures/examples/unescaped/Unescaped.php | 15 - .../examples/unescaped/unescaped.mustache | 1 - .../fixtures/examples/unescaped/unescaped.txt | 1 - .../test/fixtures/examples/utf8/UTF8.php | 15 - .../test/fixtures/examples/utf8/utf8.mustache | 1 - .../test/fixtures/examples/utf8/utf8.txt | 1 - .../examples/utf8_unescaped/UTF8Unescaped.php | 15 - .../utf8_unescaped/utf8_unescaped.mustache | 1 - .../utf8_unescaped/utf8_unescaped.txt | 1 - .../examples/whitespace/Whitespace.php | 43 -- .../whitespace/partials/alphabet.mustache | 1 - .../examples/whitespace/whitespace.mustache | 10 - .../examples/whitespace/whitespace.txt | 12 - .../mustache/test/fixtures/templates/alpha.ms | 1 - .../mustache/test/fixtures/templates/beta.ms | 1 - .../test/fixtures/templates/one.mustache | 1 - .../test/fixtures/templates/two.mustache | 1 - .../scribu/lib-posts-to-posts/composer.json | 8 +- 158 files changed, 49 insertions(+), 6196 deletions(-) create mode 100644 vendor/mustache/mustache/.gitattributes delete mode 100644 vendor/mustache/mustache/.gitignore delete mode 100644 vendor/mustache/mustache/.gitmodules delete mode 100644 vendor/mustache/mustache/.php_cs delete mode 100644 vendor/mustache/mustache/.styleci.yml delete mode 100644 vendor/mustache/mustache/.travis.yml delete mode 100644 vendor/mustache/mustache/CONTRIBUTING.md delete mode 100644 vendor/mustache/mustache/phpunit.xml.dist delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/AutoloaderTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/Cache/AbstractCacheTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/Cache/FilesystemCacheTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/CompilerTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/ContextTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/EngineTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/Exception/SyntaxExceptionTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/Exception/UnknownFilterExceptionTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/Exception/UnknownHelperExceptionTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/Exception/UnknownTemplateExceptionTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/ClosureQuirksTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/EngineTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/FiltersTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/HigherOrderSectionsTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/LambdaHelperTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/MustacheSpecTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/PartialLambdaIndentTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/StrictCallablesTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/Functional/CallTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/Functional/ExamplesTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/Functional/HigherOrderSectionsTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/Functional/InheritanceTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/Functional/MustacheInjectionTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/Functional/MustacheSpecTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/Functional/NestedPartialIndentTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/Functional/ObjectSectionTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/FunctionalTestCase.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/HelperCollectionTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/Loader/ArrayLoaderTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/Loader/CascadingLoaderTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/Loader/FilesystemLoaderTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/Loader/InlineLoaderTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/Loader/ProductionFilesystemLoaderTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/Loader/StringLoaderTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/Logger/AbstractLoggerTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/Logger/StreamLoggerTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/ParserTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/Source/FilesystemSourceTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/SpecTestCase.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/TemplateTest.php delete mode 100644 vendor/mustache/mustache/test/Mustache/Test/TokenizerTest.php delete mode 100644 vendor/mustache/mustache/test/bootstrap.php delete mode 100644 vendor/mustache/mustache/test/fixtures/autoloader/Mustache/Bar.php delete mode 100644 vendor/mustache/mustache/test/fixtures/autoloader/Mustache/Foo.php delete mode 100644 vendor/mustache/mustache/test/fixtures/autoloader/NonMustacheClass.php delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/anchored_dot_notation/AnchoredDotNotation.php delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/anchored_dot_notation/anchored_dot_notation.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/anchored_dot_notation/anchored_dot_notation.txt delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/anchored_dot_notation/partials/genre.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/blocks/Blocks.php delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/blocks/blocks.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/blocks/blocks.txt delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/blocks/partials/parent.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/child_context/ChildContext.php delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/child_context/child_context.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/child_context/child_context.txt delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/comments/Comments.php delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/comments/comments.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/comments/comments.txt delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/complex/complex.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/complex/complex.php delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/complex/complex.txt delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/delimiters/Delimiters.php delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/delimiters/delimiters.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/delimiters/delimiters.txt delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/dot_notation/DotNotation.php delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/dot_notation/dot_notation.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/dot_notation/dot_notation.txt delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/double_section/DoubleSection.php delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/double_section/double_section.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/double_section/double_section.txt delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/escaped/Escaped.php delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/escaped/escaped.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/escaped/escaped.txt delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/filters/Filters.php delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/filters/filters.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/filters/filters.txt delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/grand_parent_context/GrandParentContext.php delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/grand_parent_context/grand_parent_context.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/grand_parent_context/grand_parent_context.txt delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/i18n/I18n.php delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/i18n/i18n.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/i18n/i18n.txt delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/implicit_iterator/ImplicitIterator.php delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/implicit_iterator/implicit_iterator.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/implicit_iterator/implicit_iterator.txt delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/inverted_double_section/InvertedDoubleSection.php delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/inverted_double_section/inverted_double_section.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/inverted_double_section/inverted_double_section.txt delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/inverted_section/InvertedSection.php delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/inverted_section/inverted_section.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/inverted_section/inverted_section.txt delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/nested_partials/NestedPartials.php delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/nested_partials/nested_partials.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/nested_partials/nested_partials.txt delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/nested_partials/partials/fourth.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/nested_partials/partials/second.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/nested_partials/partials/third.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/partials/Partials.php delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/partials/partials.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/partials/partials.txt delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/partials/partials/header.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/recursive_partials/RecursivePartials.php delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/recursive_partials/partials/child.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/recursive_partials/recursive_partials.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/recursive_partials/recursive_partials.txt delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/section_iterator_objects/SectionIteratorObjects.php delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/section_iterator_objects/section_iterator_objects.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/section_iterator_objects/section_iterator_objects.txt delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/section_magic_objects/SectionMagicObjects.php delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/section_magic_objects/section_magic_objects.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/section_magic_objects/section_magic_objects.txt delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/section_objects/SectionObjects.php delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/section_objects/section_objects.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/section_objects/section_objects.txt delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/sections/Sections.php delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/sections/sections.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/sections/sections.txt delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/sections_nested/SectionsNested.php delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/sections_nested/sections_nested.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/sections_nested/sections_nested.txt delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/simple/Simple.php delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/simple/simple.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/simple/simple.txt delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/unescaped/Unescaped.php delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/unescaped/unescaped.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/unescaped/unescaped.txt delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/utf8/UTF8.php delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/utf8/utf8.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/utf8/utf8.txt delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/utf8_unescaped/UTF8Unescaped.php delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/utf8_unescaped/utf8_unescaped.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/utf8_unescaped/utf8_unescaped.txt delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/whitespace/Whitespace.php delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/whitespace/partials/alphabet.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/whitespace/whitespace.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/examples/whitespace/whitespace.txt delete mode 100644 vendor/mustache/mustache/test/fixtures/templates/alpha.ms delete mode 100644 vendor/mustache/mustache/test/fixtures/templates/beta.ms delete mode 100644 vendor/mustache/mustache/test/fixtures/templates/one.mustache delete mode 100644 vendor/mustache/mustache/test/fixtures/templates/two.mustache diff --git a/composer.json b/composer.json index 6f5e7345..869e8e5d 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "repositories": [ { "type": "vcs", - "url": "https://github.com/scribu/wp-lib-posts-to-posts" + "url": "https://github.com/jeffreyvr/wp-lib-posts-to-posts" } ] } \ No newline at end of file diff --git a/vendor/mustache/mustache/.gitattributes b/vendor/mustache/mustache/.gitattributes new file mode 100644 index 00000000..95b7ab4c --- /dev/null +++ b/vendor/mustache/mustache/.gitattributes @@ -0,0 +1,8 @@ +/test export-ignore +/CONTRIBUTING.md export-ignore +/.php_cs export-ignore +/phpunit.xml.dist export-ignore +/.travis.yml export-ignore +/.styleci.yml export-ignore +/.gitmodules export-ignore +/.gitignore export-ignore diff --git a/vendor/mustache/mustache/.gitignore b/vendor/mustache/mustache/.gitignore deleted file mode 100644 index 3861f002..00000000 --- a/vendor/mustache/mustache/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -.php_cs.cache -composer.lock -mustache.php -vendor diff --git a/vendor/mustache/mustache/.gitmodules b/vendor/mustache/mustache/.gitmodules deleted file mode 100644 index 042ea4d3..00000000 --- a/vendor/mustache/mustache/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[submodule "vendor/spec"] - path = vendor/spec - url = https://github.com/mustache/spec.git -[submodule "vendor/yaml"] - path = vendor/yaml - url = https://github.com/fabpot/yaml.git diff --git a/vendor/mustache/mustache/.php_cs b/vendor/mustache/mustache/.php_cs deleted file mode 100644 index d924712b..00000000 --- a/vendor/mustache/mustache/.php_cs +++ /dev/null @@ -1,26 +0,0 @@ -level(Symfony\CS\FixerInterface::SYMFONY_LEVEL) - ->fixers(array( - '-concat_without_spaces', - '-pre_increment', - '-unalign_double_arrow', - '-unalign_equals', - 'align_double_arrow', - 'concat_with_spaces', - 'ordered_use', - 'strict', - )) - ->setUsingLinter(false); - -$finder = $config->getFinder() - ->in('bin') - ->in('src') - ->in('test'); - -return $config; diff --git a/vendor/mustache/mustache/.styleci.yml b/vendor/mustache/mustache/.styleci.yml deleted file mode 100644 index 1aebcc37..00000000 --- a/vendor/mustache/mustache/.styleci.yml +++ /dev/null @@ -1,13 +0,0 @@ -preset: symfony - -enabled: - - align_double_arrow - - concat_with_spaces - - ordered_use - - strict - -disabled: - - concat_without_spaces - - pre_increment - - unalign_double_arrow - - unalign_equals diff --git a/vendor/mustache/mustache/.travis.yml b/vendor/mustache/mustache/.travis.yml deleted file mode 100644 index d88c6f00..00000000 --- a/vendor/mustache/mustache/.travis.yml +++ /dev/null @@ -1,31 +0,0 @@ -language: php - -sudo: false - -matrix: - include: - - php: 5.2 - dist: precise - - php: 5.3 - dist: precise - - php: 5.4 - dist: trusty - - php: 5.5 - dist: trusty - - php: 5.6 - - php: 7.0 - - php: 7.1 - - php: 7.2 - - php: 7.3 - - php: 7.4snapshot - - php: hhvm - dist: trusty - allow_failures: - - php: hhvm - - php: 7.4snapshot - -script: - - '[[ "$TRAVIS_PHP_VERSION" = 5.2* ]] && phpunit || vendor/bin/phpunit --verbose' - -install: - - '[[ "$TRAVIS_PHP_VERSION" = 5.2* ]] || composer install' diff --git a/vendor/mustache/mustache/CONTRIBUTING.md b/vendor/mustache/mustache/CONTRIBUTING.md deleted file mode 100644 index c0b323de..00000000 --- a/vendor/mustache/mustache/CONTRIBUTING.md +++ /dev/null @@ -1,35 +0,0 @@ -# Contributions welcome! - - -### Here's a quick guide: - - 1. [Fork the repo on GitHub](https://github.com/bobthecow/mustache.php). - - 2. Update submodules: `git submodule update --init` - - 3. Run the test suite. We only take pull requests with passing tests, and it's great to know that you have a clean slate. Make sure you have PHPUnit 3.5+, then run `phpunit` from the project directory. - - 4. Add tests for your change. Only refactoring and documentation changes require no new tests. If you are adding functionality or fixing a bug, add a test! - - 5. Make the tests pass. - - 6. Push your fork to GitHub and submit a pull request against the `dev` branch. - - -### You can do some things to increase the chance that your pull request is accepted the first time: - - * Submit one pull request per fix or feature. - * To help with that, do all your work in a feature branch (e.g. `feature/my-alsome-feature`). - * Follow the conventions you see used in the project. - * Use `phpcs --standard=PSR2` to check your changes against the coding standard. - * Write tests that fail without your code, and pass with it. - * Don't bump version numbers. Those will be updated — per [semver](http://semver.org) — once your change is merged into `master`. - * Update any documentation: docblocks, README, examples, etc. - * ... Don't update the wiki until your change is merged and released, but make a note in your pull request so we don't forget. - - -### Mustache.php follows the PSR-* coding standards: - - * [PSR-0: Class and file naming conventions](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md) - * [PSR-1: Basic coding standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md) - * [PSR-2: Coding style guide](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) diff --git a/vendor/mustache/mustache/README.md b/vendor/mustache/mustache/README.md index a596ace8..1560192c 100644 --- a/vendor/mustache/mustache/README.md +++ b/vendor/mustache/mustache/README.md @@ -1,7 +1,7 @@ Mustache.php ============ -A [Mustache](http://mustache.github.com/) implementation in PHP. +A [Mustache](https://mustache.github.io/) implementation in PHP. [![Package version](http://img.shields.io/packagist/v/mustache/mustache.svg?style=flat-square)](https://packagist.org/packages/mustache/mustache) [![Build status](http://img.shields.io/travis/bobthecow/mustache.php/dev.svg?style=flat-square)](http://travis-ci.org/bobthecow/mustache.php) @@ -16,7 +16,7 @@ A quick example: ```php ENT_QUOTES)); echo $m->render('Hello {{planet}}', array('planet' => 'World!')); // "Hello World!" ``` @@ -53,11 +53,12 @@ And render it: ```php ENT_QUOTES)); $chris = new Chris; echo $m->render($template, $chris); ``` +*Note:* we recommend using `ENT_QUOTES` as a default of [entity_flags](https://github.com/bobthecow/mustache.php/wiki#entity_flags) to decrease the chance of Cross-site scripting vulnerability. And That's Not All! ------------------- @@ -68,5 +69,5 @@ Read [the Mustache.php documentation](https://github.com/bobthecow/mustache.php/ See Also -------- + * [mustache(5)](http://mustache.github.io/mustache.5.html) man page. * [Readme for the Ruby Mustache implementation](https://github.com/defunkt/mustache/blob/master/README.md). - * [mustache(5)](http://mustache.github.com/mustache.5.html) man page. diff --git a/vendor/mustache/mustache/phpunit.xml.dist b/vendor/mustache/mustache/phpunit.xml.dist deleted file mode 100644 index 3c620b6f..00000000 --- a/vendor/mustache/mustache/phpunit.xml.dist +++ /dev/null @@ -1,17 +0,0 @@ - - - - ./test - ./test/Mustache/Test/FiveThree - - - - ./test/Mustache/Test/FiveThree - - - - - ./src/Mustache - - - \ No newline at end of file diff --git a/vendor/mustache/mustache/src/Mustache/Cache.php b/vendor/mustache/mustache/src/Mustache/Cache.php index 3b5b3f1b..3292efac 100644 --- a/vendor/mustache/mustache/src/Mustache/Cache.php +++ b/vendor/mustache/mustache/src/Mustache/Cache.php @@ -33,4 +33,11 @@ public function load($key); * @param string $value */ public function cache($key, $value); + + /** + * Set a logger instance. + * + * @param Mustache_Logger|Psr\Log\LoggerInterface $logger + */ + public function setLogger($logger = null); } diff --git a/vendor/mustache/mustache/src/Mustache/Cache/AbstractCache.php b/vendor/mustache/mustache/src/Mustache/Cache/AbstractCache.php index 365eafac..281038fa 100644 --- a/vendor/mustache/mustache/src/Mustache/Cache/AbstractCache.php +++ b/vendor/mustache/mustache/src/Mustache/Cache/AbstractCache.php @@ -47,7 +47,7 @@ public function setLogger($logger = null) /** * Add a log record if logging is enabled. * - * @param int $level The logging level + * @param string $level The logging level * @param string $message The log message * @param array $context The log context */ diff --git a/vendor/mustache/mustache/src/Mustache/Compiler.php b/vendor/mustache/mustache/src/Mustache/Compiler.php index 610369ed..93a295ae 100644 --- a/vendor/mustache/mustache/src/Mustache/Compiler.php +++ b/vendor/mustache/mustache/src/Mustache/Compiler.php @@ -286,7 +286,6 @@ private function blockVar($nodes, $id, $start, $end, $otag, $ctag, $level) private function blockArg($nodes, $id, $start, $end, $otag, $ctag, $level) { $key = $this->block($nodes); - $keystr = var_export($key, true); $id = var_export($id, true); return sprintf($this->prepare(self::BLOCK_ARG, $level), $id, $key); @@ -321,7 +320,6 @@ private function block($nodes) } const SECTION_CALL = ' - // %s section $value = $context->%s(%s);%s $buffer .= $this->section%s($context, $indent, $value); '; @@ -333,12 +331,12 @@ private function section%s(Mustache_Context $context, $indent, $value) if (%s) { $source = %s; - $result = call_user_func($value, $source, %s); + $result = (string) call_user_func($value, $source, %s); if (strpos($result, \'{{\') === false) { $buffer .= $result; } else { $buffer .= $this->mustache - ->loadLambda((string) $result%s) + ->loadLambda($result%s) ->renderInternal($context); } } elseif (!empty($value)) { @@ -392,11 +390,10 @@ private function section($nodes, $id, $filters, $start, $end, $otag, $ctag, $lev $id = var_export($id, true); $filters = $this->getFilters($filters, $level); - return sprintf($this->prepare(self::SECTION_CALL, $level), $id, $method, $id, $filters, $key); + return sprintf($this->prepare(self::SECTION_CALL, $level), $method, $id, $filters, $key); } const INVERTED_SECTION = ' - // %s inverted section $value = $context->%s(%s);%s if (empty($value)) { %s @@ -419,7 +416,7 @@ private function invertedSection($nodes, $id, $filters, $level) $id = var_export($id, true); $filters = $this->getFilters($filters, $level); - return sprintf($this->prepare(self::INVERTED_SECTION, $level), $id, $method, $id, $filters, $this->walk($nodes, $level)); + return sprintf($this->prepare(self::INVERTED_SECTION, $level), $method, $id, $filters, $this->walk($nodes, $level)); } const PARTIAL_INDENT = ', $indent . %s'; @@ -507,7 +504,7 @@ private static function onlyBlockArgs(array $node) const VARIABLE = ' $value = $this->resolveValue($context->%s(%s), $context);%s - $buffer .= %s%s; + $buffer .= %s($value === null ? \'\' : %s); '; /** diff --git a/vendor/mustache/mustache/src/Mustache/Engine.php b/vendor/mustache/mustache/src/Mustache/Engine.php index fe99799e..5e96e411 100644 --- a/vendor/mustache/mustache/src/Mustache/Engine.php +++ b/vendor/mustache/mustache/src/Mustache/Engine.php @@ -23,8 +23,8 @@ */ class Mustache_Engine { - const VERSION = '2.13.0'; - const SPEC_VERSION = '1.1.2'; + const VERSION = '2.14.0'; + const SPEC_VERSION = '1.2.2'; const PRAGMA_FILTERS = 'FILTERS'; const PRAGMA_BLOCKS = 'BLOCKS'; diff --git a/vendor/mustache/mustache/src/Mustache/Source/FilesystemSource.php b/vendor/mustache/mustache/src/Mustache/Source/FilesystemSource.php index 1284ac72..270f584e 100644 --- a/vendor/mustache/mustache/src/Mustache/Source/FilesystemSource.php +++ b/vendor/mustache/mustache/src/Mustache/Source/FilesystemSource.php @@ -38,7 +38,7 @@ public function __construct($fileName, array $statProps) /** * Get the Source key (used to generate the compiled class name). * - * @throws RuntimeException when a source file cannot be read + * @throws Mustache_Exception_RuntimeException when a source file cannot be read * * @return string */ @@ -54,7 +54,7 @@ public function getKey() } if ($this->stat === false) { - throw new RuntimeException(sprintf('Failed to read source file "%s".', $this->fileName)); + throw new Mustache_Exception_RuntimeException(sprintf('Failed to read source file "%s".', $this->fileName)); } foreach ($this->statProps as $prop) { diff --git a/vendor/mustache/mustache/src/Mustache/Tokenizer.php b/vendor/mustache/mustache/src/Mustache/Tokenizer.php index 6dbe0cdf..2a172c34 100644 --- a/vendor/mustache/mustache/src/Mustache/Tokenizer.php +++ b/vendor/mustache/mustache/src/Mustache/Tokenizer.php @@ -88,26 +88,31 @@ class Mustache_Tokenizer * @throws Mustache_Exception_InvalidArgumentException when $delimiters string is invalid * * @param string $text Mustache template source to tokenize - * @param string $delimiters Optionally, pass initial opening and closing delimiters (default: null) + * @param string $delimiters Optionally, pass initial opening and closing delimiters (default: empty string) * * @return array Set of Mustache tokens */ - public function scan($text, $delimiters = null) + public function scan($text, $delimiters = '') { // Setting mbstring.func_overload makes things *really* slow. // Let's do everyone a favor and scan this string as ASCII instead. // + // The INI directive was removed in PHP 8.0 so we don't need to check there (and can drop it + // when we remove support for older versions of PHP). + // // @codeCoverageIgnoreStart $encoding = null; - if (function_exists('mb_internal_encoding') && ini_get('mbstring.func_overload') & 2) { - $encoding = mb_internal_encoding(); - mb_internal_encoding('ASCII'); + if (version_compare(PHP_VERSION, '8.0.0', '<')) { + if (function_exists('mb_internal_encoding') && ini_get('mbstring.func_overload') & 2) { + $encoding = mb_internal_encoding(); + mb_internal_encoding('ASCII'); + } } // @codeCoverageIgnoreEnd $this->reset(); - if ($delimiters = trim($delimiters)) { + if (is_string($delimiters) && $delimiters = trim($delimiters)) { $this->setDelimiters($delimiters); } diff --git a/vendor/mustache/mustache/test/Mustache/Test/AutoloaderTest.php b/vendor/mustache/mustache/test/Mustache/Test/AutoloaderTest.php deleted file mode 100644 index c72effef..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/AutoloaderTest.php +++ /dev/null @@ -1,51 +0,0 @@ -assertTrue(spl_autoload_unregister(array($loader, 'autoload'))); - } - - public function testAutoloader() - { - $loader = new Mustache_Autoloader(dirname(__FILE__) . '/../../fixtures/autoloader'); - - $this->assertNull($loader->autoload('NonMustacheClass')); - $this->assertFalse(class_exists('NonMustacheClass')); - - $loader->autoload('Mustache_Foo'); - $this->assertTrue(class_exists('Mustache_Foo')); - - $loader->autoload('\Mustache_Bar'); - $this->assertTrue(class_exists('Mustache_Bar')); - } - - /** - * Test that the autoloader won't register multiple times. - */ - public function testRegisterMultiple() - { - $numLoaders = count(spl_autoload_functions()); - - Mustache_Autoloader::register(); - Mustache_Autoloader::register(); - - $expectedNumLoaders = $numLoaders + 1; - - $this->assertCount($expectedNumLoaders, spl_autoload_functions()); - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Cache/AbstractCacheTest.php b/vendor/mustache/mustache/test/Mustache/Test/Cache/AbstractCacheTest.php deleted file mode 100644 index ac47e64f..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/Cache/AbstractCacheTest.php +++ /dev/null @@ -1,44 +0,0 @@ -setLogger($logger); - $this->assertSame($logger, $cache->getLogger()); - } - - /** - * @expectedException Mustache_Exception_InvalidArgumentException - */ - public function testSetLoggerThrowsExceptions() - { - $cache = new CacheStub(); - $logger = new StdClass(); - $cache->setLogger($logger); - } -} - -class CacheStub extends Mustache_Cache_AbstractCache -{ - public function load($key) - { - // nada - } - - public function cache($key, $value) - { - // nada - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Cache/FilesystemCacheTest.php b/vendor/mustache/mustache/test/Mustache/Test/Cache/FilesystemCacheTest.php deleted file mode 100644 index 6bcc483d..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/Cache/FilesystemCacheTest.php +++ /dev/null @@ -1,36 +0,0 @@ -load($key); - - $this->assertFalse($loaded); - } - - public function testCachePut() - { - $key = 'some key'; - $value = 'cache($key, $value); - $loaded = $cache->load($key); - - $this->assertTrue($loaded); - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/CompilerTest.php b/vendor/mustache/mustache/test/Mustache/Test/CompilerTest.php deleted file mode 100644 index 6fd1986f..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/CompilerTest.php +++ /dev/null @@ -1,154 +0,0 @@ -compile($source, $tree, $name, $customEscaper, $charset, false, $entityFlags); - foreach ($expected as $contains) { - $this->assertContains($contains, $compiled); - } - } - - public function getCompileValues() - { - return array( - array('', array(), 'Banana', false, ENT_COMPAT, 'ISO-8859-1', array( - "\nclass Banana extends Mustache_Template", - 'return $buffer;', - )), - - array('', array($this->createTextToken('TEXT')), 'Monkey', false, ENT_COMPAT, 'UTF-8', array( - "\nclass Monkey extends Mustache_Template", - '$buffer .= $indent . \'TEXT\';', - 'return $buffer;', - )), - - array( - '', - array( - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, - Mustache_Tokenizer::NAME => 'name', - ), - ), - 'Monkey', - true, - ENT_COMPAT, - 'ISO-8859-1', - array( - "\nclass Monkey extends Mustache_Template", - '$value = $this->resolveValue($context->find(\'name\'), $context);', - '$buffer .= $indent . call_user_func($this->mustache->getEscape(), $value);', - 'return $buffer;', - ), - ), - - array( - '', - array( - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, - Mustache_Tokenizer::NAME => 'name', - ), - ), - 'Monkey', - false, - ENT_COMPAT, - 'ISO-8859-1', - array( - "\nclass Monkey extends Mustache_Template", - '$value = $this->resolveValue($context->find(\'name\'), $context);', - '$buffer .= $indent . htmlspecialchars($value, ' . ENT_COMPAT . ', \'ISO-8859-1\');', - 'return $buffer;', - ), - ), - - array( - '', - array( - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, - Mustache_Tokenizer::NAME => 'name', - ), - ), - 'Monkey', - false, - ENT_QUOTES, - 'ISO-8859-1', - array( - "\nclass Monkey extends Mustache_Template", - '$value = $this->resolveValue($context->find(\'name\'), $context);', - '$buffer .= $indent . htmlspecialchars($value, ' . ENT_QUOTES . ', \'ISO-8859-1\');', - 'return $buffer;', - ), - ), - - array( - '', - array( - $this->createTextToken("foo\n"), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, - Mustache_Tokenizer::NAME => 'name', - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, - Mustache_Tokenizer::NAME => '.', - ), - $this->createTextToken("'bar'"), - ), - 'Monkey', - false, - ENT_COMPAT, - 'UTF-8', - array( - "\nclass Monkey extends Mustache_Template", - "\$buffer .= \$indent . 'foo\n';", - '$value = $this->resolveValue($context->find(\'name\'), $context);', - '$buffer .= htmlspecialchars($value, ' . ENT_COMPAT . ', \'UTF-8\');', - '$value = $this->resolveValue($context->last(), $context);', - '$buffer .= \'\\\'bar\\\'\';', - 'return $buffer;', - ), - ), - ); - } - - /** - * @expectedException Mustache_Exception_SyntaxException - */ - public function testCompilerThrowsSyntaxException() - { - $compiler = new Mustache_Compiler(); - $compiler->compile('', array(array(Mustache_Tokenizer::TYPE => 'invalid')), 'SomeClass'); - } - - /** - * @param string $value - */ - private function createTextToken($value) - { - return array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, - Mustache_Tokenizer::VALUE => $value, - ); - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/ContextTest.php b/vendor/mustache/mustache/test/Mustache/Test/ContextTest.php deleted file mode 100644 index 447ea161..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/ContextTest.php +++ /dev/null @@ -1,282 +0,0 @@ -assertSame('', $one->find('foo')); - $this->assertSame('', $one->find('bar')); - - $two = new Mustache_Context(array( - 'foo' => 'FOO', - 'bar' => '', - )); - $this->assertEquals('FOO', $two->find('foo')); - $this->assertEquals('', $two->find('bar')); - - $obj = new StdClass(); - $obj->name = 'NAME'; - $three = new Mustache_Context($obj); - $this->assertSame($obj, $three->last()); - $this->assertEquals('NAME', $three->find('name')); - } - - public function testPushPopAndLast() - { - $context = new Mustache_Context(); - $this->assertFalse($context->last()); - - $dummy = new Mustache_Test_TestDummy(); - $context->push($dummy); - $this->assertSame($dummy, $context->last()); - $this->assertSame($dummy, $context->pop()); - $this->assertFalse($context->last()); - - $obj = new StdClass(); - $context->push($dummy); - $this->assertSame($dummy, $context->last()); - $context->push($obj); - $this->assertSame($obj, $context->last()); - $this->assertSame($obj, $context->pop()); - $this->assertSame($dummy, $context->pop()); - $this->assertFalse($context->last()); - } - - public function testFind() - { - $context = new Mustache_Context(); - - $dummy = new Mustache_Test_TestDummy(); - - $obj = new StdClass(); - $obj->name = 'obj'; - - $arr = array( - 'a' => array('b' => array('c' => 'see')), - 'b' => 'bee', - ); - - $string = 'some arbitrary string'; - - $context->push($dummy); - $this->assertEquals('dummy', $context->find('name')); - - $context->push($obj); - $this->assertEquals('obj', $context->find('name')); - - $context->pop(); - $this->assertEquals('dummy', $context->find('name')); - - $dummy->name = 'dummyer'; - $this->assertEquals('dummyer', $context->find('name')); - - $context->push($arr); - $this->assertEquals('bee', $context->find('b')); - $this->assertEquals('see', $context->findDot('a.b.c')); - - $dummy->name = 'dummy'; - - $context->push($string); - $this->assertSame($string, $context->last()); - $this->assertEquals('dummy', $context->find('name')); - $this->assertEquals('see', $context->findDot('a.b.c')); - $this->assertEquals('', $context->find('foo')); - $this->assertEquals('', $context->findDot('bar')); - } - - public function testArrayAccessFind() - { - $access = new Mustache_Test_TestArrayAccess(array( - 'a' => array('b' => array('c' => 'see')), - 'b' => 'bee', - )); - - $context = new Mustache_Context($access); - $this->assertEquals('bee', $context->find('b')); - $this->assertEquals('see', $context->findDot('a.b.c')); - $this->assertEquals(null, $context->findDot('a.b.c.d')); - } - - public function testAccessorPriority() - { - $context = new Mustache_Context(new Mustache_Test_AllTheThings()); - - $this->assertEquals('win', $context->find('foo'), 'method beats property'); - $this->assertEquals('win', $context->find('bar'), 'property beats ArrayAccess'); - $this->assertEquals('win', $context->find('baz'), 'ArrayAccess stands alone'); - $this->assertEquals('win', $context->find('qux'), 'ArrayAccess beats private property'); - } - - public function testAnchoredDotNotation() - { - $context = new Mustache_Context(); - - $a = array( - 'name' => 'a', - 'number' => 1, - ); - - $b = array( - 'number' => 2, - 'child' => array( - 'name' => 'baby bee', - ), - ); - - $c = array( - 'name' => 'cee', - ); - - $context->push($a); - $this->assertEquals('a', $context->find('name')); - $this->assertEquals('', $context->findDot('.name')); - $this->assertEquals('a', $context->findAnchoredDot('.name')); - $this->assertEquals(1, $context->find('number')); - $this->assertEquals('', $context->findDot('.number')); - $this->assertEquals(1, $context->findAnchoredDot('.number')); - - $context->push($b); - $this->assertEquals('a', $context->find('name')); - $this->assertEquals(2, $context->find('number')); - $this->assertEquals('', $context->findDot('.name')); - $this->assertEquals('', $context->findDot('.number')); - $this->assertEquals('', $context->findAnchoredDot('.name')); - $this->assertEquals(2, $context->findAnchoredDot('.number')); - $this->assertEquals('baby bee', $context->findDot('child.name')); - $this->assertEquals('', $context->findDot('.child.name')); - $this->assertEquals('baby bee', $context->findAnchoredDot('.child.name')); - - $context->push($c); - $this->assertEquals('cee', $context->find('name')); - $this->assertEquals('', $context->findDot('.name')); - $this->assertEquals('cee', $context->findAnchoredDot('.name')); - $this->assertEquals(2, $context->find('number')); - $this->assertEquals('', $context->findDot('.number')); - $this->assertEquals('', $context->findAnchoredDot('.number')); - $this->assertEquals('baby bee', $context->findDot('child.name')); - $this->assertEquals('', $context->findDot('.child.name')); - $this->assertEquals('', $context->findAnchoredDot('.child.name')); - } - - /** - * @expectedException Mustache_Exception_InvalidArgumentException - */ - public function testAnchoredDotNotationThrowsExceptions() - { - $context = new Mustache_Context(); - $context->push(array('a' => 1)); - $context->findAnchoredDot('a'); - } -} - -class Mustache_Test_TestDummy -{ - public $name = 'dummy'; - - public function __invoke() - { - // nothing - } - - public static function foo() - { - return ''; - } - - public function bar() - { - return ''; - } -} - -class Mustache_Test_TestArrayAccess implements ArrayAccess -{ - private $container = array(); - - public function __construct($array) - { - foreach ($array as $key => $value) { - $this->container[$key] = $value; - } - } - - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } -} - -class Mustache_Test_AllTheThings implements ArrayAccess -{ - public $foo = 'fail'; - public $bar = 'win'; - private $qux = 'fail'; - - public function foo() - { - return 'win'; - } - - public function offsetExists($offset) - { - return true; - } - - public function offsetGet($offset) - { - switch ($offset) { - case 'foo': - case 'bar': - return 'fail'; - - case 'baz': - case 'qux': - return 'win'; - - default: - return 'lolwhut'; - } - } - - public function offsetSet($offset, $value) - { - // nada - } - - public function offsetUnset($offset) - { - // nada - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/EngineTest.php b/vendor/mustache/mustache/test/Mustache/Test/EngineTest.php deleted file mode 100644 index 3e4d193b..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/EngineTest.php +++ /dev/null @@ -1,397 +0,0 @@ - '__whot__', - 'cache' => self::$tempDir, - 'cache_file_mode' => 777, - 'logger' => $logger, - 'loader' => $loader, - 'partials_loader' => $partialsLoader, - 'partials' => array( - 'foo' => '{{ foo }}', - ), - 'helpers' => array( - 'foo' => array($this, 'getFoo'), - 'bar' => 'BAR', - ), - 'escape' => 'strtoupper', - 'entity_flags' => ENT_QUOTES, - 'charset' => 'ISO-8859-1', - 'pragmas' => array(Mustache_Engine::PRAGMA_FILTERS), - )); - - $this->assertSame($logger, $mustache->getLogger()); - $this->assertSame($loader, $mustache->getLoader()); - $this->assertSame($partialsLoader, $mustache->getPartialsLoader()); - $this->assertEquals('{{ foo }}', $partialsLoader->load('foo')); - $this->assertContains('__whot__', $mustache->getTemplateClassName('{{ foo }}')); - $this->assertEquals('strtoupper', $mustache->getEscape()); - $this->assertEquals(ENT_QUOTES, $mustache->getEntityFlags()); - $this->assertEquals('ISO-8859-1', $mustache->getCharset()); - $this->assertTrue($mustache->hasHelper('foo')); - $this->assertTrue($mustache->hasHelper('bar')); - $this->assertFalse($mustache->hasHelper('baz')); - $this->assertInstanceOf('Mustache_Cache_FilesystemCache', $mustache->getCache()); - $this->assertEquals(array(Mustache_Engine::PRAGMA_FILTERS), $mustache->getPragmas()); - } - - public static function getFoo() - { - return 'foo'; - } - - public function testRender() - { - $source = '{{ foo }}'; - $data = array('bar' => 'baz'); - $output = 'TEH OUTPUT'; - - $template = $this->getMockBuilder('Mustache_Template') - ->disableOriginalConstructor() - ->getMock(); - - $mustache = new MustacheStub(); - $mustache->template = $template; - - $template->expects($this->once()) - ->method('render') - ->with($data) - ->will($this->returnValue($output)); - - $this->assertEquals($output, $mustache->render($source, $data)); - $this->assertEquals($source, $mustache->source); - } - - public function testSettingServices() - { - $logger = new Mustache_Logger_StreamLogger(tmpfile()); - $loader = new Mustache_Loader_StringLoader(); - $tokenizer = new Mustache_Tokenizer(); - $parser = new Mustache_Parser(); - $compiler = new Mustache_Compiler(); - $mustache = new Mustache_Engine(); - $cache = new Mustache_Cache_FilesystemCache(self::$tempDir); - - $this->assertNotSame($logger, $mustache->getLogger()); - $mustache->setLogger($logger); - $this->assertSame($logger, $mustache->getLogger()); - - $this->assertNotSame($loader, $mustache->getLoader()); - $mustache->setLoader($loader); - $this->assertSame($loader, $mustache->getLoader()); - - $this->assertNotSame($loader, $mustache->getPartialsLoader()); - $mustache->setPartialsLoader($loader); - $this->assertSame($loader, $mustache->getPartialsLoader()); - - $this->assertNotSame($tokenizer, $mustache->getTokenizer()); - $mustache->setTokenizer($tokenizer); - $this->assertSame($tokenizer, $mustache->getTokenizer()); - - $this->assertNotSame($parser, $mustache->getParser()); - $mustache->setParser($parser); - $this->assertSame($parser, $mustache->getParser()); - - $this->assertNotSame($compiler, $mustache->getCompiler()); - $mustache->setCompiler($compiler); - $this->assertSame($compiler, $mustache->getCompiler()); - - $this->assertNotSame($cache, $mustache->getCache()); - $mustache->setCache($cache); - $this->assertSame($cache, $mustache->getCache()); - } - - /** - * @group functional - */ - public function testCache() - { - $mustache = new Mustache_Engine(array( - 'template_class_prefix' => '__whot__', - 'cache' => self::$tempDir, - )); - - $source = '{{ foo }}'; - $template = $mustache->loadTemplate($source); - $className = $mustache->getTemplateClassName($source); - - $this->assertInstanceOf($className, $template); - } - - public function testLambdaCache() - { - $mustache = new MustacheStub(array( - 'cache' => self::$tempDir, - 'cache_lambda_templates' => true, - )); - - $this->assertNotInstanceOf('Mustache_Cache_NoopCache', $mustache->getProtectedLambdaCache()); - $this->assertSame($mustache->getCache(), $mustache->getProtectedLambdaCache()); - } - - public function testWithoutLambdaCache() - { - $mustache = new MustacheStub(array( - 'cache' => self::$tempDir, - )); - - $this->assertInstanceOf('Mustache_Cache_NoopCache', $mustache->getProtectedLambdaCache()); - $this->assertNotSame($mustache->getCache(), $mustache->getProtectedLambdaCache()); - } - - /** - * @expectedException Mustache_Exception_InvalidArgumentException - */ - public function testEmptyTemplatePrefixThrowsException() - { - new Mustache_Engine(array( - 'template_class_prefix' => '', - )); - } - - /** - * @expectedException Mustache_Exception_InvalidArgumentException - * @dataProvider getBadEscapers - */ - public function testNonCallableEscapeThrowsException($escape) - { - new Mustache_Engine(array('escape' => $escape)); - } - - public function getBadEscapers() - { - return array( - array('nothing'), - array('foo', 'bar'), - ); - } - - /** - * @expectedException Mustache_Exception_RuntimeException - */ - public function testImmutablePartialsLoadersThrowException() - { - $mustache = new Mustache_Engine(array( - 'partials_loader' => new Mustache_Loader_StringLoader(), - )); - - $mustache->setPartials(array('foo' => '{{ foo }}')); - } - - public function testMissingPartialsTreatedAsEmptyString() - { - $mustache = new Mustache_Engine(array( - 'partials_loader' => new Mustache_Loader_ArrayLoader(array( - 'foo' => 'FOO', - 'baz' => 'BAZ', - )), - )); - - $this->assertEquals('FOOBAZ', $mustache->render('{{>foo}}{{>bar}}{{>baz}}', array())); - } - - public function testHelpers() - { - $foo = array($this, 'getFoo'); - $bar = 'BAR'; - $mustache = new Mustache_Engine(array('helpers' => array( - 'foo' => $foo, - 'bar' => $bar, - ))); - - $helpers = $mustache->getHelpers(); - $this->assertTrue($mustache->hasHelper('foo')); - $this->assertTrue($mustache->hasHelper('bar')); - $this->assertTrue($helpers->has('foo')); - $this->assertTrue($helpers->has('bar')); - $this->assertSame($foo, $mustache->getHelper('foo')); - $this->assertSame($bar, $mustache->getHelper('bar')); - - $mustache->removeHelper('bar'); - $this->assertFalse($mustache->hasHelper('bar')); - $mustache->addHelper('bar', $bar); - $this->assertSame($bar, $mustache->getHelper('bar')); - - $baz = array($this, 'wrapWithUnderscores'); - $this->assertFalse($mustache->hasHelper('baz')); - $this->assertFalse($helpers->has('baz')); - - $mustache->addHelper('baz', $baz); - $this->assertTrue($mustache->hasHelper('baz')); - $this->assertTrue($helpers->has('baz')); - - // ... and a functional test - $tpl = $mustache->loadTemplate('{{foo}} - {{bar}} - {{#baz}}qux{{/baz}}'); - $this->assertEquals('foo - BAR - __qux__', $tpl->render()); - $this->assertEquals('foo - BAR - __qux__', $tpl->render(array('qux' => "won't mess things up"))); - } - - public static function wrapWithUnderscores($text) - { - return '__' . $text . '__'; - } - - /** - * @expectedException Mustache_Exception_InvalidArgumentException - */ - public function testSetHelpersThrowsExceptions() - { - $mustache = new Mustache_Engine(); - $mustache->setHelpers('monkeymonkeymonkey'); - } - - /** - * @expectedException Mustache_Exception_InvalidArgumentException - */ - public function testSetLoggerThrowsExceptions() - { - $mustache = new Mustache_Engine(); - $mustache->setLogger(new StdClass()); - } - - public function testLoadPartialCascading() - { - $loader = new Mustache_Loader_ArrayLoader(array( - 'foo' => 'FOO', - )); - - $mustache = new Mustache_Engine(array('loader' => $loader)); - - $tpl = $mustache->loadTemplate('foo'); - - $this->assertSame($tpl, $mustache->loadPartial('foo')); - - $mustache->setPartials(array( - 'foo' => 'f00', - )); - - // setting partials overrides the default template loading fallback. - $this->assertNotSame($tpl, $mustache->loadPartial('foo')); - - // but it didn't overwrite the original template loader templates. - $this->assertSame($tpl, $mustache->loadTemplate('foo')); - } - - public function testPartialLoadFailLogging() - { - $name = tempnam(sys_get_temp_dir(), 'mustache-test'); - $mustache = new Mustache_Engine(array( - 'logger' => new Mustache_Logger_StreamLogger($name, Mustache_Logger::WARNING), - 'partials' => array( - 'foo' => 'FOO', - 'bar' => 'BAR', - ), - )); - - $result = $mustache->render('{{> foo }}{{> bar }}{{> baz }}', array()); - $this->assertEquals('FOOBAR', $result); - - $this->assertContains('WARNING: Partial not found: "baz"', file_get_contents($name)); - } - - public function testCacheWarningLogging() - { - list($name, $mustache) = $this->getLoggedMustache(Mustache_Logger::WARNING); - $mustache->render('{{ foo }}', array('foo' => 'FOO')); - $this->assertContains('WARNING: Template cache disabled, evaluating', file_get_contents($name)); - } - - public function testLoggingIsNotTooAnnoying() - { - list($name, $mustache) = $this->getLoggedMustache(); - $mustache->render('{{ foo }}{{> bar }}', array('foo' => 'FOO')); - $this->assertEmpty(file_get_contents($name)); - } - - public function testVerboseLoggingIsVerbose() - { - list($name, $mustache) = $this->getLoggedMustache(Mustache_Logger::DEBUG); - $mustache->render('{{ foo }}{{> bar }}', array('foo' => 'FOO')); - $log = file_get_contents($name); - $this->assertContains('DEBUG: Instantiating template: ', $log); - $this->assertContains('WARNING: Partial not found: "bar"', $log); - } - - /** - * @expectedException Mustache_Exception_InvalidArgumentException - */ - public function testUnknownPragmaThrowsException() - { - new Mustache_Engine(array( - 'pragmas' => array('UNKNOWN'), - )); - } - - public function testCompileFromMustacheSourceInstance() - { - $baseDir = realpath(dirname(__FILE__) . '/../../fixtures/templates'); - $mustache = new Mustache_Engine(array( - 'loader' => new Mustache_Loader_ProductionFilesystemLoader($baseDir), - )); - $this->assertEquals('one contents', $mustache->render('one')); - } - - private function getLoggedMustache($level = Mustache_Logger::ERROR) - { - $name = tempnam(sys_get_temp_dir(), 'mustache-test'); - $mustache = new Mustache_Engine(array( - 'logger' => new Mustache_Logger_StreamLogger($name, $level), - )); - - return array($name, $mustache); - } - - public function testCustomDelimiters() - { - $mustache = new Mustache_Engine(array( - 'delimiters' => '[[ ]]', - 'partials' => array( - 'one' => '[[> two ]]', - 'two' => '[[ a ]]', - ), - )); - - $tpl = $mustache->loadTemplate('[[# a ]][[ b ]][[/a ]]'); - $this->assertEquals('c', $tpl->render(array('a' => true, 'b' => 'c'))); - - $tpl = $mustache->loadTemplate('[[> one ]]'); - $this->assertEquals('b', $tpl->render(array('a' => 'b'))); - } -} - -class MustacheStub extends Mustache_Engine -{ - public $source; - public $template; - - public function loadTemplate($source) - { - $this->source = $source; - - return $this->template; - } - - public function getProtectedLambdaCache() - { - return $this->getLambdaCache(); - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Exception/SyntaxExceptionTest.php b/vendor/mustache/mustache/test/Mustache/Test/Exception/SyntaxExceptionTest.php deleted file mode 100644 index 074dafcd..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/Exception/SyntaxExceptionTest.php +++ /dev/null @@ -1,39 +0,0 @@ - 'this')); - $this->assertTrue($e instanceof LogicException); - $this->assertTrue($e instanceof Mustache_Exception); - } - - public function testGetToken() - { - $token = array(Mustache_Tokenizer::TYPE => 'whatever'); - $e = new Mustache_Exception_SyntaxException('ignore this', $token); - $this->assertEquals($token, $e->getToken()); - } - - public function testPrevious() - { - if (version_compare(PHP_VERSION, '5.3.0', '<')) { - $this->markTestSkipped('Exception chaining requires at least PHP 5.3'); - } - - $previous = new Exception(); - $e = new Mustache_Exception_SyntaxException('foo', array(), $previous); - - $this->assertSame($previous, $e->getPrevious()); - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Exception/UnknownFilterExceptionTest.php b/vendor/mustache/mustache/test/Mustache/Test/Exception/UnknownFilterExceptionTest.php deleted file mode 100644 index 6dbe25e3..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/Exception/UnknownFilterExceptionTest.php +++ /dev/null @@ -1,44 +0,0 @@ -assertTrue($e instanceof UnexpectedValueException); - $this->assertTrue($e instanceof Mustache_Exception); - } - - public function testMessage() - { - $e = new Mustache_Exception_UnknownFilterException('sausage'); - $this->assertEquals('Unknown filter: sausage', $e->getMessage()); - } - - public function testGetFilterName() - { - $e = new Mustache_Exception_UnknownFilterException('eggs'); - $this->assertEquals('eggs', $e->getFilterName()); - } - - public function testPrevious() - { - if (version_compare(PHP_VERSION, '5.3.0', '<')) { - $this->markTestSkipped('Exception chaining requires at least PHP 5.3'); - } - - $previous = new Exception(); - $e = new Mustache_Exception_UnknownFilterException('foo', $previous); - - $this->assertSame($previous, $e->getPrevious()); - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Exception/UnknownHelperExceptionTest.php b/vendor/mustache/mustache/test/Mustache/Test/Exception/UnknownHelperExceptionTest.php deleted file mode 100644 index 5b1ccbb6..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/Exception/UnknownHelperExceptionTest.php +++ /dev/null @@ -1,43 +0,0 @@ -assertTrue($e instanceof InvalidArgumentException); - $this->assertTrue($e instanceof Mustache_Exception); - } - - public function testMessage() - { - $e = new Mustache_Exception_UnknownHelperException('beta'); - $this->assertEquals('Unknown helper: beta', $e->getMessage()); - } - - public function testGetHelperName() - { - $e = new Mustache_Exception_UnknownHelperException('gamma'); - $this->assertEquals('gamma', $e->getHelperName()); - } - - public function testPrevious() - { - if (version_compare(PHP_VERSION, '5.3.0', '<')) { - $this->markTestSkipped('Exception chaining requires at least PHP 5.3'); - } - - $previous = new Exception(); - $e = new Mustache_Exception_UnknownHelperException('foo', $previous); - $this->assertSame($previous, $e->getPrevious()); - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Exception/UnknownTemplateExceptionTest.php b/vendor/mustache/mustache/test/Mustache/Test/Exception/UnknownTemplateExceptionTest.php deleted file mode 100644 index b993bfa8..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/Exception/UnknownTemplateExceptionTest.php +++ /dev/null @@ -1,43 +0,0 @@ -assertTrue($e instanceof InvalidArgumentException); - $this->assertTrue($e instanceof Mustache_Exception); - } - - public function testMessage() - { - $e = new Mustache_Exception_UnknownTemplateException('luigi'); - $this->assertEquals('Unknown template: luigi', $e->getMessage()); - } - - public function testGetTemplateName() - { - $e = new Mustache_Exception_UnknownTemplateException('yoshi'); - $this->assertEquals('yoshi', $e->getTemplateName()); - } - - public function testPrevious() - { - if (version_compare(PHP_VERSION, '5.3.0', '<')) { - $this->markTestSkipped('Exception chaining requires at least PHP 5.3'); - } - - $previous = new Exception(); - $e = new Mustache_Exception_UnknownTemplateException('foo', $previous); - $this->assertSame($previous, $e->getPrevious()); - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/ClosureQuirksTest.php b/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/ClosureQuirksTest.php deleted file mode 100644 index cc575a9d..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/ClosureQuirksTest.php +++ /dev/null @@ -1,32 +0,0 @@ -mustache = new Mustache_Engine(); - } - - public function testClosuresDontLikeItWhenYouTouchTheirProperties() - { - $tpl = $this->mustache->loadTemplate('{{ foo.bar }}'); - $this->assertEquals('', $tpl->render(array('foo' => function () { - return 'FOO'; - }))); - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/EngineTest.php b/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/EngineTest.php deleted file mode 100644 index 406473eb..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/EngineTest.php +++ /dev/null @@ -1,50 +0,0 @@ - $pragmas, - 'helpers' => $helpers, - )); - - $this->assertEquals($expect, $mustache->render($tpl, $data)); - } - - public function pragmaData() - { - $helpers = array( - 'longdate' => function (\DateTime $value) { - return $value->format('Y-m-d h:m:s'); - }, - ); - - $data = array( - 'date' => new DateTime('1/1/2000', new DateTimeZone('UTC')), - ); - - $tpl = '{{ date | longdate }}'; - - return array( - array(array(Mustache_Engine::PRAGMA_FILTERS), $helpers, $data, $tpl, '2000-01-01 12:01:00'), - array(array(), $helpers, $data, $tpl, ''), - ); - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/FiltersTest.php b/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/FiltersTest.php deleted file mode 100644 index 16dec608..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/FiltersTest.php +++ /dev/null @@ -1,187 +0,0 @@ -mustache = new Mustache_Engine(); - } - - /** - * @dataProvider singleFilterData - */ - public function testSingleFilter($tpl, $helpers, $data, $expect) - { - $this->mustache->setHelpers($helpers); - $this->assertEquals($expect, $this->mustache->render($tpl, $data)); - } - - public function singleFilterData() - { - $helpers = array( - 'longdate' => function (\DateTime $value) { - return $value->format('Y-m-d h:m:s'); - }, - 'echo' => function ($value) { - return array($value, $value, $value); - }, - ); - - return array( - array( - '{{% FILTERS }}{{ date | longdate }}', - $helpers, - (object) array('date' => new DateTime('1/1/2000', new DateTimeZone('UTC'))), - '2000-01-01 12:01:00', - ), - - array( - '{{% FILTERS }}{{# word | echo }}{{ . }}!{{/ word | echo }}', - $helpers, - array('word' => 'bacon'), - 'bacon!bacon!bacon!', - ), - ); - } - - public function testChainedFilters() - { - $tpl = $this->mustache->loadTemplate('{{% FILTERS }}{{ date | longdate | withbrackets }}'); - - $this->mustache->addHelper('longdate', function (\DateTime $value) { - return $value->format('Y-m-d h:m:s'); - }); - - $this->mustache->addHelper('withbrackets', function ($value) { - return sprintf('[[%s]]', $value); - }); - - $foo = new \StdClass(); - $foo->date = new DateTime('1/1/2000', new DateTimeZone('UTC')); - - $this->assertEquals('[[2000-01-01 12:01:00]]', $tpl->render($foo)); - } - - const CHAINED_SECTION_FILTERS_TPL = <<<'EOS' -{{% FILTERS }} -{{# word | echo | with_index }} -{{ key }}: {{ value }} -{{/ word | echo | with_index }} -EOS; - - public function testChainedSectionFilters() - { - $tpl = $this->mustache->loadTemplate(self::CHAINED_SECTION_FILTERS_TPL); - - $this->mustache->addHelper('echo', function ($value) { - return array($value, $value, $value); - }); - - $this->mustache->addHelper('with_index', function ($value) { - return array_map(function ($k, $v) { - return array( - 'key' => $k, - 'value' => $v, - ); - }, array_keys($value), $value); - }); - - $this->assertEquals("0: bacon\n1: bacon\n2: bacon\n", $tpl->render(array('word' => 'bacon'))); - } - - /** - * @dataProvider interpolateFirstData - */ - public function testInterpolateFirst($tpl, $data, $expect) - { - $this->assertEquals($expect, $this->mustache->render($tpl, $data)); - } - - public function interpolateFirstData() - { - $data = array( - 'foo' => 'FOO', - 'bar' => function ($value) { - return ($value === 'FOO') ? 'win!' : 'fail :('; - }, - ); - - return array( - array('{{% FILTERS }}{{ foo | bar }}', $data, 'win!'), - array('{{% FILTERS }}{{# foo | bar }}{{ . }}{{/ foo | bar }}', $data, 'win!'), - ); - } - - /** - * @expectedException Mustache_Exception_UnknownFilterException - * @dataProvider brokenPipeData - */ - public function testThrowsExceptionForBrokenPipes($tpl, $data) - { - $this->mustache->render($tpl, $data); - } - - public function brokenPipeData() - { - return array( - array('{{% FILTERS }}{{ foo | bar }}', array()), - array('{{% FILTERS }}{{ foo | bar }}', array('foo' => 'FOO')), - array('{{% FILTERS }}{{ foo | bar }}', array('foo' => 'FOO', 'bar' => 'BAR')), - array('{{% FILTERS }}{{ foo | bar }}', array('foo' => 'FOO', 'bar' => array(1, 2))), - array('{{% FILTERS }}{{ foo | bar | baz }}', array('foo' => 'FOO', 'bar' => function () { - return 'BAR'; - })), - array('{{% FILTERS }}{{ foo | bar | baz }}', array('foo' => 'FOO', 'baz' => function () { - return 'BAZ'; - })), - array('{{% FILTERS }}{{ foo | bar | baz }}', array('bar' => function () { - return 'BAR'; - })), - array('{{% FILTERS }}{{ foo | bar | baz }}', array('baz' => function () { - return 'BAZ'; - })), - array('{{% FILTERS }}{{ foo | bar.baz }}', array('foo' => 'FOO', 'bar' => function () { - return 'BAR'; - }, 'baz' => function () { - return 'BAZ'; - })), - - array('{{% FILTERS }}{{# foo | bar }}{{ . }}{{/ foo | bar }}', array()), - array('{{% FILTERS }}{{# foo | bar }}{{ . }}{{/ foo | bar }}', array('foo' => 'FOO')), - array('{{% FILTERS }}{{# foo | bar }}{{ . }}{{/ foo | bar }}', array('foo' => 'FOO', 'bar' => 'BAR')), - array('{{% FILTERS }}{{# foo | bar }}{{ . }}{{/ foo | bar }}', array('foo' => 'FOO', 'bar' => array(1, 2))), - array('{{% FILTERS }}{{# foo | bar | baz }}{{ . }}{{/ foo | bar | baz }}', array('foo' => 'FOO', 'bar' => function () { - return 'BAR'; - })), - array('{{% FILTERS }}{{# foo | bar | baz }}{{ . }}{{/ foo | bar | baz }}', array('foo' => 'FOO', 'baz' => function () { - return 'BAZ'; - })), - array('{{% FILTERS }}{{# foo | bar | baz }}{{ . }}{{/ foo | bar | baz }}', array('bar' => function () { - return 'BAR'; - })), - array('{{% FILTERS }}{{# foo | bar | baz }}{{ . }}{{/ foo | bar | baz }}', array('baz' => function () { - return 'BAZ'; - })), - array('{{% FILTERS }}{{# foo | bar.baz }}{{ . }}{{/ foo | bar.baz }}', array('foo' => 'FOO', 'bar' => function () { - return 'BAR'; - }, 'baz' => function () { - return 'BAZ'; - })), - ); - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/HigherOrderSectionsTest.php b/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/HigherOrderSectionsTest.php deleted file mode 100644 index eb051504..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/HigherOrderSectionsTest.php +++ /dev/null @@ -1,77 +0,0 @@ -mustache = new Mustache_Engine(); - } - - public function testAnonymousFunctionSectionCallback() - { - $tpl = $this->mustache->loadTemplate('{{#wrapper}}{{name}}{{/wrapper}}'); - - $foo = new Mustache_Test_FiveThree_Functional_Foo(); - $foo->name = 'Mario'; - $foo->wrapper = function ($text) { - return sprintf('
%s
', $text); - }; - - $this->assertEquals(sprintf('
%s
', $foo->name), $tpl->render($foo)); - } - - public function testSectionCallback() - { - $one = $this->mustache->loadTemplate('{{name}}'); - $two = $this->mustache->loadTemplate('{{#wrap}}{{name}}{{/wrap}}'); - - $foo = new Mustache_Test_FiveThree_Functional_Foo(); - $foo->name = 'Luigi'; - - $this->assertEquals($foo->name, $one->render($foo)); - $this->assertEquals(sprintf('%s', $foo->name), $two->render($foo)); - } - - public function testViewArrayAnonymousSectionCallback() - { - $tpl = $this->mustache->loadTemplate('{{#wrap}}{{name}}{{/wrap}}'); - - $data = array( - 'name' => 'Bob', - 'wrap' => function ($text) { - return sprintf('[[%s]]', $text); - }, - ); - - $this->assertEquals(sprintf('[[%s]]', $data['name']), $tpl->render($data)); - } -} - -class Mustache_Test_FiveThree_Functional_Foo -{ - public $name = 'Justin'; - public $lorem = 'Lorem ipsum dolor sit amet,'; - public $wrap; - - public function __construct() - { - $this->wrap = function ($text) { - return sprintf('%s', $text); - }; - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/LambdaHelperTest.php b/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/LambdaHelperTest.php deleted file mode 100644 index 6fc5d400..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/LambdaHelperTest.php +++ /dev/null @@ -1,67 +0,0 @@ -mustache = new Mustache_Engine(); - } - - public function testSectionLambdaHelper() - { - $one = $this->mustache->loadTemplate('{{name}}'); - $two = $this->mustache->loadTemplate('{{#lambda}}{{name}}{{/lambda}}'); - - $foo = new StdClass(); - $foo->name = 'Mario'; - $foo->lambda = function ($text, $mustache) { - return strtoupper($mustache->render($text)); - }; - - $this->assertEquals('Mario', $one->render($foo)); - $this->assertEquals('MARIO', $two->render($foo)); - } - - public function testSectionLambdaHelperRespectsDelimiterChanges() - { - $tpl = $this->mustache->loadTemplate("{{=<% %>=}}\n<%# bang %><% value %><%/ bang %>"); - - $data = new StdClass(); - $data->value = 'hello world'; - $data->bang = function ($text, $mustache) { - return $mustache->render($text) . '!'; - }; - - $this->assertEquals('hello world!', $tpl->render($data)); - } - - public function testLambdaHelperIsInvokable() - { - $one = $this->mustache->loadTemplate('{{name}}'); - $two = $this->mustache->loadTemplate('{{#lambda}}{{name}}{{/lambda}}'); - - $foo = new StdClass(); - $foo->name = 'Mario'; - $foo->lambda = function ($text, $render) { - return strtoupper($render($text)); - }; - - $this->assertEquals('Mario', $one->render($foo)); - $this->assertEquals('MARIO', $two->render($foo)); - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/MustacheSpecTest.php b/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/MustacheSpecTest.php deleted file mode 100644 index af3f982b..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/MustacheSpecTest.php +++ /dev/null @@ -1,68 +0,0 @@ -markTestSkipped('Mustache spec submodule not initialized: run "git submodule update --init"'); - } - } - - /** - * @group lambdas - * @dataProvider loadLambdasSpec - */ - public function testLambdasSpec($desc, $source, $partials, $data, $expected) - { - $template = self::loadTemplate($source, $partials); - $this->assertEquals($expected, $template($this->prepareLambdasSpec($data)), $desc); - } - - public function loadLambdasSpec() - { - return $this->loadSpec('~lambdas'); - } - - /** - * Extract and lambdafy any 'lambda' values found in the $data array. - */ - private function prepareLambdasSpec($data) - { - foreach ($data as $key => $val) { - if ($key === 'lambda') { - if (!isset($val['php'])) { - $this->markTestSkipped(sprintf('PHP lambda test not implemented for this test.')); - } - - $func = $val['php']; - $data[$key] = function ($text = null) use ($func) { - return eval($func); - }; - } elseif (is_array($val)) { - $data[$key] = $this->prepareLambdasSpec($val); - } - } - - return $data; - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/PartialLambdaIndentTest.php b/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/PartialLambdaIndentTest.php deleted file mode 100644 index 1f9af7ca..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/PartialLambdaIndentTest.php +++ /dev/null @@ -1,94 +0,0 @@ - - {{> input }} - - -EOS; - $partial = <<<'EOS' - - -EOS; - - $expected = <<<'EOS' -
- -
- -EOS; - - $m = new Mustache_Engine(array( - 'partials' => array('input' => $partial), - )); - - $tpl = $m->loadTemplate($src); - - $data = new Mustache_Test_FiveThree_Functional_ClassWithLambda(); - $this->assertEquals($expected, $tpl->render($data)); - } - - public function testLambdaInterpolationsInsidePartialsAreIndentedProperly() - { - $src = <<<'EOS' -
- {{> input }} -
- -EOS; - $partial = <<<'EOS' - - -EOS; - - $expected = <<<'EOS' -
- -
- -EOS; - - $m = new Mustache_Engine(array( - 'partials' => array('input' => $partial), - )); - - $tpl = $m->loadTemplate($src); - - $data = new Mustache_Test_FiveThree_Functional_ClassWithLambda(); - $this->assertEquals($expected, $tpl->render($data)); - } -} - -class Mustache_Test_FiveThree_Functional_ClassWithLambda -{ - public function _t() - { - return function ($val) { - return strtoupper($val); - }; - } - - public function placeholder() - { - return function () { - return 'Enter your name'; - }; - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/StrictCallablesTest.php b/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/StrictCallablesTest.php deleted file mode 100644 index 2c01169e..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/StrictCallablesTest.php +++ /dev/null @@ -1,135 +0,0 @@ - $strict)); - $tpl = $mustache->loadTemplate('{{# section }}{{ name }}{{/ section }}'); - - $data = new StdClass(); - $data->name = $name; - $data->section = $section; - - $this->assertEquals($expected, $tpl->render($data)); - } - - public function callables() - { - $lambda = function ($tpl, $mustache) { - return strtoupper($mustache->render($tpl)); - }; - - return array( - // Interpolation lambdas - array( - false, - array($this, 'instanceName'), - $lambda, - 'YOSHI', - ), - array( - false, - array(__CLASS__, 'staticName'), - $lambda, - 'YOSHI', - ), - array( - false, - function () { - return 'Yoshi'; - }, - $lambda, - 'YOSHI', - ), - - // Section lambdas - array( - false, - 'Yoshi', - array($this, 'instanceCallable'), - 'YOSHI', - ), - array( - false, - 'Yoshi', - array(__CLASS__, 'staticCallable'), - 'YOSHI', - ), - array( - false, - 'Yoshi', - $lambda, - 'YOSHI', - ), - - // Strict interpolation lambdas - array( - true, - function () { - return 'Yoshi'; - }, - $lambda, - 'YOSHI', - ), - - // Strict section lambdas - array( - true, - 'Yoshi', - array($this, 'instanceCallable'), - 'YoshiYoshi', - ), - array( - true, - 'Yoshi', - array(__CLASS__, 'staticCallable'), - 'YoshiYoshi', - ), - array( - true, - 'Yoshi', - function ($tpl, $mustache) { - return strtoupper($mustache->render($tpl)); - }, - 'YOSHI', - ), - ); - } - - public function instanceCallable($tpl, $mustache) - { - return strtoupper($mustache->render($tpl)); - } - - public static function staticCallable($tpl, $mustache) - { - return strtoupper($mustache->render($tpl)); - } - - public function instanceName() - { - return 'Yoshi'; - } - - public static function staticName() - { - return 'Yoshi'; - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Functional/CallTest.php b/vendor/mustache/mustache/test/Mustache/Test/Functional/CallTest.php deleted file mode 100644 index 681ec1bc..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/Functional/CallTest.php +++ /dev/null @@ -1,40 +0,0 @@ -loadTemplate('{{# foo }}{{ label }}: {{ name }}{{/ foo }}'); - - $foo = new Mustache_Test_Functional_ClassWithCall(); - $foo->name = 'Bob'; - - $data = array('label' => 'name', 'foo' => $foo); - - $this->assertEquals('name: Bob', $tpl->render($data)); - } -} - -class Mustache_Test_Functional_ClassWithCall -{ - public $name; - - public function __call($method, $args) - { - return 'unknown value'; - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Functional/ExamplesTest.php b/vendor/mustache/mustache/test/Mustache/Test/Functional/ExamplesTest.php deleted file mode 100644 index ac883ea4..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/Functional/ExamplesTest.php +++ /dev/null @@ -1,142 +0,0 @@ - $partials, - )); - $this->assertEquals($expected, $mustache->loadTemplate($source)->render($context)); - } - - /** - * Data provider for testExamples method. - * - * Loads examples from the test fixtures directory. - * - * This examples directory should contain any number of subdirectories, each of which contains - * three files: one Mustache class (.php), one Mustache template (.mustache), and one output file - * (.txt). Optionally, the directory may contain a folder full of partials. - * - * @return array - */ - public function getExamples() - { - $path = realpath(dirname(__FILE__) . '/../../../fixtures/examples'); - $examples = array(); - - $handle = opendir($path); - while (($file = readdir($handle)) !== false) { - if ($file === '.' || $file === '..') { - continue; - } - - $fullpath = $path . '/' . $file; - if (is_dir($fullpath)) { - $examples[$file] = $this->loadExample($fullpath); - } - } - closedir($handle); - - return $examples; - } - - /** - * Helper method to load an example given the full path. - * - * @param string $path - * - * @return array arguments for testExamples - */ - private function loadExample($path) - { - $context = null; - $source = null; - $partials = array(); - $expected = null; - - $handle = opendir($path); - while (($file = readdir($handle)) !== false) { - $fullpath = $path . '/' . $file; - $info = pathinfo($fullpath); - - if (is_dir($fullpath) && $info['basename'] === 'partials') { - // load partials - $partials = $this->loadPartials($fullpath); - } elseif (is_file($fullpath)) { - // load other files - switch ($info['extension']) { - case 'php': - require_once $fullpath; - $className = $info['filename']; - $context = new $className(); - break; - - case 'mustache': - $source = file_get_contents($fullpath); - break; - - case 'txt': - $expected = file_get_contents($fullpath); - break; - } - } - } - closedir($handle); - - return array($context, $source, $partials, $expected); - } - - /** - * Helper method to load partials given an example directory. - * - * @param string $path - * - * @return array $partials - */ - private function loadPartials($path) - { - $partials = array(); - - $handle = opendir($path); - while (($file = readdir($handle)) !== false) { - if ($file === '.' || $file === '..') { - continue; - } - - $fullpath = $path . '/' . $file; - $info = pathinfo($fullpath); - - if ($info['extension'] === 'mustache') { - $partials[$info['filename']] = file_get_contents($fullpath); - } - } - closedir($handle); - - return $partials; - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Functional/HigherOrderSectionsTest.php b/vendor/mustache/mustache/test/Mustache/Test/Functional/HigherOrderSectionsTest.php deleted file mode 100644 index 14774cd2..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/Functional/HigherOrderSectionsTest.php +++ /dev/null @@ -1,177 +0,0 @@ -mustache = new Mustache_Engine(); - } - - /** - * @dataProvider sectionCallbackData - */ - public function testSectionCallback($data, $tpl, $expect) - { - $this->assertEquals($expect, $this->mustache->render($tpl, $data)); - } - - public function sectionCallbackData() - { - $foo = new Mustache_Test_Functional_Foo(); - $foo->doublewrap = array($foo, 'wrapWithBoth'); - - $bar = new Mustache_Test_Functional_Foo(); - $bar->trimmer = array(get_class($bar), 'staticTrim'); - - return array( - array($foo, '{{#doublewrap}}{{name}}{{/doublewrap}}', sprintf('%s', $foo->name)), - array($bar, '{{#trimmer}} {{name}} {{/trimmer}}', $bar->name), - ); - } - - public function testViewArraySectionCallback() - { - $tpl = $this->mustache->loadTemplate('{{#trim}} {{name}} {{/trim}}'); - - $foo = new Mustache_Test_Functional_Foo(); - - $data = array( - 'name' => 'Bob', - 'trim' => array(get_class($foo), 'staticTrim'), - ); - - $this->assertEquals($data['name'], $tpl->render($data)); - } - - public function testMonsters() - { - $tpl = $this->mustache->loadTemplate('{{#title}}{{title}} {{/title}}{{name}}'); - - $frank = new Mustache_Test_Functional_Monster(); - $frank->title = 'Dr.'; - $frank->name = 'Frankenstein'; - $this->assertEquals('Dr. Frankenstein', $tpl->render($frank)); - - $dracula = new Mustache_Test_Functional_Monster(); - $dracula->title = 'Count'; - $dracula->name = 'Dracula'; - $this->assertEquals('Count Dracula', $tpl->render($dracula)); - } - - public function testPassthroughOptimization() - { - $mustache = $this->getMock('Mustache_Engine', array('loadLambda')); - $mustache->expects($this->never()) - ->method('loadLambda'); - - $tpl = $mustache->loadTemplate('{{#wrap}}NAME{{/wrap}}'); - - $foo = new Mustache_Test_Functional_Foo(); - $foo->wrap = array($foo, 'wrapWithEm'); - - $this->assertEquals('NAME', $tpl->render($foo)); - } - - public function testWithoutPassthroughOptimization() - { - $mustache = $this->getMock('Mustache_Engine', array('loadLambda')); - $mustache->expects($this->once()) - ->method('loadLambda') - ->will($this->returnValue($mustache->loadTemplate('{{ name }}'))); - - $tpl = $mustache->loadTemplate('{{#wrap}}{{name}}{{/wrap}}'); - - $foo = new Mustache_Test_Functional_Foo(); - $foo->wrap = array($foo, 'wrapWithEm'); - - $this->assertEquals('' . $foo->name . '', $tpl->render($foo)); - } - - /** - * @dataProvider cacheLambdaTemplatesData - */ - public function testCacheLambdaTemplatesOptionWorks($dirName, $tplPrefix, $enable, $expect) - { - $cacheDir = $this->setUpCacheDir($dirName); - $mustache = new Mustache_Engine(array( - 'template_class_prefix' => $tplPrefix, - 'cache' => $cacheDir, - 'cache_lambda_templates' => $enable, - )); - - $tpl = $mustache->loadTemplate('{{#wrap}}{{name}}{{/wrap}}'); - $foo = new Mustache_Test_Functional_Foo(); - $foo->wrap = array($foo, 'wrapWithEm'); - $this->assertEquals('' . $foo->name . '', $tpl->render($foo)); - $this->assertCount($expect, glob($cacheDir . '/*.php')); - } - - public function cacheLambdaTemplatesData() - { - return array( - array('test_enabling_lambda_cache', '_TestEnablingLambdaCache_', true, 2), - array('test_disabling_lambda_cache', '_TestDisablingLambdaCache_', false, 1), - ); - } - - protected function setUpCacheDir($name) - { - $cacheDir = self::$tempDir . '/' . $name; - if (file_exists($cacheDir)) { - self::rmdir($cacheDir); - } - mkdir($cacheDir, 0777, true); - - return $cacheDir; - } -} - -class Mustache_Test_Functional_Foo -{ - public $name = 'Justin'; - public $lorem = 'Lorem ipsum dolor sit amet,'; - - public function wrapWithEm($text) - { - return sprintf('%s', $text); - } - - /** - * @param string $text - */ - public function wrapWithStrong($text) - { - return sprintf('%s', $text); - } - - public function wrapWithBoth($text) - { - return self::wrapWithStrong(self::wrapWithEm($text)); - } - - public static function staticTrim($text) - { - return trim($text); - } -} - -class Mustache_Test_Functional_Monster -{ - public $title; - public $name; -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Functional/InheritanceTest.php b/vendor/mustache/mustache/test/Mustache/Test/Functional/InheritanceTest.php deleted file mode 100644 index 62437041..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/Functional/InheritanceTest.php +++ /dev/null @@ -1,543 +0,0 @@ -mustache = new Mustache_Engine(array( - 'pragmas' => array(Mustache_Engine::PRAGMA_BLOCKS), - )); - } - - public function getIllegalInheritanceExamples() - { - return array( - array( - array( - 'foo' => '{{$baz}}default content{{/baz}}', - ), - array( - 'bar' => 'set by user', - ), - '{{< foo }}{{# bar }}{{$ baz }}{{/ baz }}{{/ bar }}{{/ foo }}', - ), - array( - array( - 'foo' => '{{$baz}}default content{{/baz}}', - ), - array( - ), - '{{ '{{$baz}}default content{{/baz}}', - 'qux' => 'I am a partial', - ), - array( - ), - '{{qux}}{{$baz}}set by template{{/baz}}{{/foo}}', - ), - array( - array( - 'foo' => '{{$baz}}default content{{/baz}}', - ), - array(), - '{{=}}<%={{ }}=%>{{/foo}}', - ), - ); - } - - public function getLegalInheritanceExamples() - { - return array( - array( - array( - 'foo' => '{{$baz}}default content{{/baz}}', - ), - array( - 'bar' => 'set by user', - ), - '{{ '{{$baz}}default content{{/baz}}', - ), - array( - ), - '{{ '{{$baz}}defualt content{{/baz}}', - ), - array(), - '{{ '{{$a}}FAIL!{{/a}}', - 'bar' => 'WIN!!', - ), - array(), - '{{mustache->loadTemplate('{{$title}}Default title{{/title}}'); - - $data = array(); - - $this->assertEquals('Default title', $tpl->render($data)); - } - - public function testDefaultContentRendersVariables() - { - $tpl = $this->mustache->loadTemplate('{{$foo}}default {{bar}} content{{/foo}}'); - - $data = array( - 'bar' => 'baz', - ); - - $this->assertEquals('default baz content', $tpl->render($data)); - } - - public function testDefaultContentRendersTripleMustacheVariables() - { - $tpl = $this->mustache->loadTemplate('{{$foo}}default {{{bar}}} content{{/foo}}'); - - $data = array( - 'bar' => '', - ); - - $this->assertEquals('default content', $tpl->render($data)); - } - - public function testDefaultContentRendersSections() - { - $tpl = $this->mustache->loadTemplate( - '{{$foo}}default {{#bar}}{{baz}}{{/bar}} content{{/foo}}' - ); - - $data = array( - 'bar' => array('baz' => 'qux'), - ); - - $this->assertEquals('default qux content', $tpl->render($data)); - } - - public function testDefaultContentRendersNegativeSections() - { - $tpl = $this->mustache->loadTemplate( - '{{$foo}}default {{^bar}}{{baz}}{{/bar}} content{{/foo}}' - ); - - $data = array( - 'foo' => array('bar' => 'qux'), - 'baz' => 'three', - ); - - $this->assertEquals('default three content', $tpl->render($data)); - } - - public function testMustacheInjectionInDefaultContent() - { - $tpl = $this->mustache->loadTemplate( - '{{$foo}}default {{#bar}}{{baz}}{{/bar}} content{{/foo}}' - ); - - $data = array( - 'bar' => array('baz' => '{{qux}}'), - ); - - $this->assertEquals('default {{qux}} content', $tpl->render($data)); - } - - public function testDefaultContentRenderedInsideIncludedTemplates() - { - $partials = array( - 'include' => '{{$foo}}default content{{/foo}}', - ); - - $this->mustache->setPartials($partials); - - $tpl = $this->mustache->loadTemplate( - '{{assertEquals('default content', $tpl->render($data)); - } - - public function testOverriddenContent() - { - $partials = array( - 'super' => '...{{$title}}Default title{{/title}}...', - ); - - $this->mustache->setPartials($partials); - - $tpl = $this->mustache->loadTemplate( - '{{assertEquals('...sub template title...', $tpl->render($data)); - } - - public function testOverriddenPartial() - { - $partials = array( - 'partial' => '|{{$stuff}}...{{/stuff}}{{$default}} default{{/default}}|', - ); - - $this->mustache->setPartials($partials); - - $tpl = $this->mustache->loadTemplate( - 'test {{assertEquals('test |override1 default| |override2 default|', $tpl->render($data)); - } - - public function testBlocksDoNotLeakBetweenPartials() - { - $partials = array( - 'partial' => '|{{$a}}A{{/a}} {{$b}}B{{/b}}|', - ); - - $this->mustache->setPartials($partials); - - $tpl = $this->mustache->loadTemplate( - 'test {{assertEquals('test |C B| |A D|', $tpl->render($data)); - } - - public function testDataDoesNotOverrideBlock() - { - $partials = array( - 'include' => '{{$var}}var in include{{/var}}', - ); - - $this->mustache->setPartials($partials); - - $tpl = $this->mustache->loadTemplate( - '{{ 'var in data', - ); - - $this->assertEquals('var in template', $tpl->render($data)); - } - - public function testDataDoesNotOverrideDefaultBlockValue() - { - $partials = array( - 'include' => '{{$var}}var in include{{/var}}', - ); - - $this->mustache->setPartials($partials); - - $tpl = $this->mustache->loadTemplate( - '{{ 'var in data', - ); - - $this->assertEquals('var in include', $tpl->render($data)); - } - - public function testOverridePartialWithNewlines() - { - $partials = array( - 'partial' => '{{$ballmer}}peaking{{/ballmer}}', - ); - - $this->mustache->setPartials($partials); - - $tpl = $this->mustache->loadTemplate( - "{{assertEquals("peaked\n\n:(\n", $tpl->render($data)); - } - - public function testInheritIndentationWhenOverridingAPartial() - { - $partials = array( - 'partial' => 'stop: - {{$nineties}}collaborate and listen{{/nineties}}', - ); - - $this->mustache->setPartials($partials); - - $tpl = $this->mustache->loadTemplate( - '{{assertEquals( - 'stop: - hammer time', - $tpl->render($data) - ); - } - - public function testInheritSpacingWhenOverridingAPartial() - { - $partials = array( - 'parent' => 'collaborate_and{{$id}}{{/id}}', - 'child' => '{{mustache->setPartials($partials); - - $tpl = $this->mustache->loadTemplate( - 'stop: - {{>child}}' - ); - - $data = array(); - - $this->assertEquals( - 'stop: - collaborate_and_listen', - $tpl->render($data) - ); - } - - public function testOverrideOneSubstitutionButNotTheOther() - { - $partials = array( - 'partial' => '{{$stuff}}default one{{/stuff}}, {{$stuff2}}default two{{/stuff2}}', - ); - - $this->mustache->setPartials($partials); - - $tpl = $this->mustache->loadTemplate( - '{{assertEquals('default one, override two', $tpl->render($data)); - } - - public function testSuperTemplatesWithNoParameters() - { - $partials = array( - 'include' => '{{$foo}}default content{{/foo}}', - ); - - $this->mustache->setPartials($partials); - - $tpl = $this->mustache->loadTemplate( - '{{>include}}|{{assertEquals('default content|default content', $tpl->render($data)); - } - - public function testRecursionInInheritedTemplates() - { - $partials = array( - 'include' => '{{$foo}}default content{{/foo}} {{$bar}}{{ '{{$foo}}include2 default content{{/foo}} {{mustache->setPartials($partials); - - $tpl = $this->mustache->loadTemplate( - '{{assertEquals('override override override don\'t recurse', $tpl->render($data)); - } - - public function testTopLevelSubstitutionsTakePrecedenceInMultilevelInheritance() - { - $partials = array( - 'parent' => '{{ '{{ '{{$a}}g{{/a}}', - ); - - $this->mustache->setPartials($partials); - - $tpl = $this->mustache->loadTemplate( - '{{assertEquals('c', $tpl->render($data)); - } - - public function testMultiLevelInheritanceNoSubChild() - { - $partials = array( - 'parent' => '{{ '{{ '{{$a}}g{{/a}}', - ); - - $this->mustache->setPartials($partials); - - $tpl = $this->mustache->loadTemplate( - '{{assertEquals('p', $tpl->render($data)); - } - - public function testIgnoreTextInsideSuperTemplatesButParseArgs() - { - $partials = array( - 'include' => '{{$foo}}default content{{/foo}}', - ); - - $this->mustache->setPartials($partials); - - $tpl = $this->mustache->loadTemplate( - '{{assertEquals('hmm', $tpl->render($data)); - } - - public function testIgnoreTextInsideSuperTemplates() - { - $partials = array( - 'include' => '{{$foo}}default content{{/foo}}', - ); - - $this->mustache->setPartials($partials); - - $tpl = $this->mustache->loadTemplate( - '{{assertEquals('default content', $tpl->render($data)); - } - - public function testInheritanceWithLazyEvaluation() - { - $partials = array( - 'parent' => '{{#items}}{{$value}}ignored{{/value}}{{/items}}', - ); - - $this->mustache->setPartials($partials); - - $tpl = $this->mustache->loadTemplate( - '{{{{/value}}{{/parent}}' - ); - - $data = array('items' => array(1, 2, 3)); - - $this->assertEquals('<1><2><3>', $tpl->render($data)); - } - - public function testInheritanceWithLazyEvaluationWhitespaceIgnored() - { - $partials = array( - 'parent' => '{{#items}}{{$value}}\n\nignored\n\n{{/value}}{{/items}}', - ); - - $this->mustache->setPartials($partials); - - $tpl = $this->mustache->loadTemplate( - '{{{{/value}}\n\n{{/parent}}' - ); - - $data = array('items' => array(1, 2, 3)); - - $this->assertEquals('<1><2><3>', $tpl->render($data)); - } - - public function testInheritanceWithLazyEvaluationAndSections() - { - $partials = array( - 'parent' => '{{#items}}{{$value}}\n\nignored {{.}} {{#more}} there is more {{/more}}\n\n{{/value}}{{/items}}', - ); - - $this->mustache->setPartials($partials); - - $tpl = $this->mustache->loadTemplate( - '{{{{#more}} there is less {{/more}}{{/value}}\n\n{{/parent}}' - ); - - $data = array('items' => array(1, 2, 3), 'more' => 'stuff'); - - $this->assertEquals('<1> there is less <2> there is less <3> there is less ', $tpl->render($data)); - } - - /** - * @dataProvider getIllegalInheritanceExamples - * @expectedException Mustache_Exception_SyntaxException - * @expectedExceptionMessage Illegal content in < parent tag - */ - public function testIllegalInheritanceExamples($partials, $data, $template) - { - $this->mustache->setPartials($partials); - $tpl = $this->mustache->loadTemplate($template); - $tpl->render($data); - } - - /** - * @dataProvider getLegalInheritanceExamples - */ - public function testLegalInheritanceExamples($partials, $data, $template, $expect) - { - $this->mustache->setPartials($partials); - $tpl = $this->mustache->loadTemplate($template); - $this->assertSame($expect, $tpl->render($data)); - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Functional/MustacheInjectionTest.php b/vendor/mustache/mustache/test/Mustache/Test/Functional/MustacheInjectionTest.php deleted file mode 100644 index 7a9d6acd..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/Functional/MustacheInjectionTest.php +++ /dev/null @@ -1,83 +0,0 @@ -mustache = new Mustache_Engine(); - } - - /** - * @dataProvider injectionData - */ - public function testInjection($tpl, $data, $partials, $expect) - { - $this->mustache->setPartials($partials); - $this->assertEquals($expect, $this->mustache->render($tpl, $data)); - } - - public function injectionData() - { - $interpolationData = array( - 'a' => '{{ b }}', - 'b' => 'FAIL', - ); - - $sectionData = array( - 'a' => true, - 'b' => '{{ c }}', - 'c' => 'FAIL', - ); - - $lambdaInterpolationData = array( - 'a' => array($this, 'lambdaInterpolationCallback'), - 'b' => '{{ c }}', - 'c' => 'FAIL', - ); - - $lambdaSectionData = array( - 'a' => array($this, 'lambdaSectionCallback'), - 'b' => '{{ c }}', - 'c' => 'FAIL', - ); - - return array( - array('{{ a }}', $interpolationData, array(), '{{ b }}'), - array('{{{ a }}}', $interpolationData, array(), '{{ b }}'), - - array('{{# a }}{{ b }}{{/ a }}', $sectionData, array(), '{{ c }}'), - array('{{# a }}{{{ b }}}{{/ a }}', $sectionData, array(), '{{ c }}'), - - array('{{> partial }}', $interpolationData, array('partial' => '{{ a }}'), '{{ b }}'), - array('{{> partial }}', $interpolationData, array('partial' => '{{{ a }}}'), '{{ b }}'), - - array('{{ a }}', $lambdaInterpolationData, array(), '{{ c }}'), - array('{{# a }}b{{/ a }}', $lambdaSectionData, array(), '{{ c }}'), - ); - } - - public static function lambdaInterpolationCallback() - { - return '{{ b }}'; - } - - public static function lambdaSectionCallback($text) - { - return '{{ ' . $text . ' }}'; - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Functional/MustacheSpecTest.php b/vendor/mustache/mustache/test/Mustache/Test/Functional/MustacheSpecTest.php deleted file mode 100644 index 6cde602e..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/Functional/MustacheSpecTest.php +++ /dev/null @@ -1,121 +0,0 @@ -markTestSkipped('Mustache spec submodule not initialized: run "git submodule update --init"'); - } - } - - /** - * @group comments - * @dataProvider loadCommentSpec - */ - public function testCommentSpec($desc, $source, $partials, $data, $expected) - { - $template = self::loadTemplate($source, $partials); - $this->assertEquals($expected, $template->render($data), $desc); - } - - public function loadCommentSpec() - { - return $this->loadSpec('comments'); - } - - /** - * @group delimiters - * @dataProvider loadDelimitersSpec - */ - public function testDelimitersSpec($desc, $source, $partials, $data, $expected) - { - $template = self::loadTemplate($source, $partials); - $this->assertEquals($expected, $template->render($data), $desc); - } - - public function loadDelimitersSpec() - { - return $this->loadSpec('delimiters'); - } - - /** - * @group interpolation - * @dataProvider loadInterpolationSpec - */ - public function testInterpolationSpec($desc, $source, $partials, $data, $expected) - { - $template = self::loadTemplate($source, $partials); - $this->assertEquals($expected, $template->render($data), $desc); - } - - public function loadInterpolationSpec() - { - return $this->loadSpec('interpolation'); - } - - /** - * @group inverted - * @group inverted-sections - * @dataProvider loadInvertedSpec - */ - public function testInvertedSpec($desc, $source, $partials, $data, $expected) - { - $template = self::loadTemplate($source, $partials); - $this->assertEquals($expected, $template->render($data), $desc); - } - - public function loadInvertedSpec() - { - return $this->loadSpec('inverted'); - } - - /** - * @group partials - * @dataProvider loadPartialsSpec - */ - public function testPartialsSpec($desc, $source, $partials, $data, $expected) - { - $template = self::loadTemplate($source, $partials); - $this->assertEquals($expected, $template->render($data), $desc); - } - - public function loadPartialsSpec() - { - return $this->loadSpec('partials'); - } - - /** - * @group sections - * @dataProvider loadSectionsSpec - */ - public function testSectionsSpec($desc, $source, $partials, $data, $expected) - { - $template = self::loadTemplate($source, $partials); - $this->assertEquals($expected, $template->render($data), $desc); - } - - public function loadSectionsSpec() - { - return $this->loadSpec('sections'); - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Functional/NestedPartialIndentTest.php b/vendor/mustache/mustache/test/Mustache/Test/Functional/NestedPartialIndentTest.php deleted file mode 100644 index 90af4d95..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/Functional/NestedPartialIndentTest.php +++ /dev/null @@ -1,45 +0,0 @@ - $partials, - )); - $tpl = $m->loadTemplate($src); - $this->assertEquals($expected, $tpl->render()); - } - - public function partialsAndStuff() - { - $partials = array( - 'a' => ' {{> b }}', - 'b' => ' {{> d }}', - 'c' => ' {{> d }}{{> d }}', - 'd' => 'D!', - ); - - return array( - array(' {{> a }}', $partials, ' D!'), - array(' {{> b }}', $partials, ' D!'), - array(' {{> c }}', $partials, ' D!D!'), - ); - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Functional/ObjectSectionTest.php b/vendor/mustache/mustache/test/Mustache/Test/Functional/ObjectSectionTest.php deleted file mode 100644 index 3cf01e18..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/Functional/ObjectSectionTest.php +++ /dev/null @@ -1,110 +0,0 @@ -mustache = new Mustache_Engine(); - } - - public function testBasicObject() - { - $tpl = $this->mustache->loadTemplate('{{#foo}}{{name}}{{/foo}}'); - $this->assertEquals('Foo', $tpl->render(new Mustache_Test_Functional_Alpha())); - } - - /** - * @group magic_methods - */ - public function testObjectWithGet() - { - $tpl = $this->mustache->loadTemplate('{{#foo}}{{name}}{{/foo}}'); - $this->assertEquals('Foo', $tpl->render(new Mustache_Test_Functional_Beta())); - } - - /** - * @group magic_methods - */ - public function testSectionObjectWithGet() - { - $tpl = $this->mustache->loadTemplate('{{#bar}}{{#foo}}{{name}}{{/foo}}{{/bar}}'); - $this->assertEquals('Foo', $tpl->render(new Mustache_Test_Functional_Gamma())); - } - - public function testSectionObjectWithFunction() - { - $tpl = $this->mustache->loadTemplate('{{#foo}}{{name}}{{/foo}}'); - $alpha = new Mustache_Test_Functional_Alpha(); - $alpha->foo = new Mustache_Test_Functional_Delta(); - $this->assertEquals('Foo', $tpl->render($alpha)); - } -} - -class Mustache_Test_Functional_Alpha -{ - public $foo; - - public function __construct() - { - $this->foo = new StdClass(); - $this->foo->name = 'Foo'; - $this->foo->number = 1; - } -} - -class Mustache_Test_Functional_Beta -{ - protected $_data = array(); - - public function __construct() - { - $this->_data['foo'] = new StdClass(); - $this->_data['foo']->name = 'Foo'; - $this->_data['foo']->number = 1; - } - - public function __isset($name) - { - return array_key_exists($name, $this->_data); - } - - public function __get($name) - { - return $this->_data[$name]; - } -} - -class Mustache_Test_Functional_Gamma -{ - public $bar; - - public function __construct() - { - $this->bar = new Mustache_Test_Functional_Beta(); - } -} - -class Mustache_Test_Functional_Delta -{ - protected $_name = 'Foo'; - - public function name() - { - return $this->_name; - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/FunctionalTestCase.php b/vendor/mustache/mustache/test/Mustache/Test/FunctionalTestCase.php deleted file mode 100644 index 213b045e..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/FunctionalTestCase.php +++ /dev/null @@ -1,47 +0,0 @@ - $foo, - 'bar' => $bar, - )); - - $this->assertSame($foo, $helpers->get('foo')); - $this->assertSame($bar, $helpers->get('bar')); - } - - public static function getFoo() - { - echo 'foo'; - } - - public function testAccessorsAndMutators() - { - $foo = array($this, 'getFoo'); - $bar = 'BAR'; - - $helpers = new Mustache_HelperCollection(); - $this->assertTrue($helpers->isEmpty()); - $this->assertFalse($helpers->has('foo')); - $this->assertFalse($helpers->has('bar')); - - $helpers->add('foo', $foo); - $this->assertFalse($helpers->isEmpty()); - $this->assertTrue($helpers->has('foo')); - $this->assertFalse($helpers->has('bar')); - - $helpers->add('bar', $bar); - $this->assertFalse($helpers->isEmpty()); - $this->assertTrue($helpers->has('foo')); - $this->assertTrue($helpers->has('bar')); - - $helpers->remove('foo'); - $this->assertFalse($helpers->isEmpty()); - $this->assertFalse($helpers->has('foo')); - $this->assertTrue($helpers->has('bar')); - } - - public function testMagicMethods() - { - $foo = array($this, 'getFoo'); - $bar = 'BAR'; - - $helpers = new Mustache_HelperCollection(); - $this->assertTrue($helpers->isEmpty()); - $this->assertFalse($helpers->has('foo')); - $this->assertFalse($helpers->has('bar')); - $this->assertFalse(isset($helpers->foo)); - $this->assertFalse(isset($helpers->bar)); - - $helpers->foo = $foo; - $this->assertFalse($helpers->isEmpty()); - $this->assertTrue($helpers->has('foo')); - $this->assertFalse($helpers->has('bar')); - $this->assertTrue(isset($helpers->foo)); - $this->assertFalse(isset($helpers->bar)); - - $helpers->bar = $bar; - $this->assertFalse($helpers->isEmpty()); - $this->assertTrue($helpers->has('foo')); - $this->assertTrue($helpers->has('bar')); - $this->assertTrue(isset($helpers->foo)); - $this->assertTrue(isset($helpers->bar)); - - unset($helpers->foo); - $this->assertFalse($helpers->isEmpty()); - $this->assertFalse($helpers->has('foo')); - $this->assertTrue($helpers->has('bar')); - $this->assertFalse(isset($helpers->foo)); - $this->assertTrue(isset($helpers->bar)); - } - - /** - * @dataProvider getInvalidHelperArguments - */ - public function testHelperCollectionIsntAfraidToThrowExceptions($helpers = array(), $actions = array(), $exception = null) - { - if ($exception) { - $this->setExpectedException($exception); - } - - $helpers = new Mustache_HelperCollection($helpers); - - foreach ($actions as $method => $args) { - call_user_func_array(array($helpers, $method), $args); - } - } - - public function getInvalidHelperArguments() - { - return array( - array( - 'not helpers', - array(), - 'InvalidArgumentException', - ), - array( - array(), - array('get' => array('foo')), - 'InvalidArgumentException', - ), - array( - array('foo' => 'FOO'), - array('get' => array('foo')), - null, - ), - array( - array('foo' => 'FOO'), - array('get' => array('bar')), - 'InvalidArgumentException', - ), - array( - array('foo' => 'FOO'), - array( - 'add' => array('bar', 'BAR'), - 'get' => array('bar'), - ), - null, - ), - array( - array('foo' => 'FOO'), - array( - 'get' => array('foo'), - 'remove' => array('foo'), - ), - null, - ), - array( - array('foo' => 'FOO'), - array( - 'remove' => array('foo'), - 'get' => array('foo'), - ), - 'InvalidArgumentException', - ), - array( - array(), - array('remove' => array('foo')), - 'InvalidArgumentException', - ), - ); - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Loader/ArrayLoaderTest.php b/vendor/mustache/mustache/test/Mustache/Test/Loader/ArrayLoaderTest.php deleted file mode 100644 index 1f309878..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/Loader/ArrayLoaderTest.php +++ /dev/null @@ -1,52 +0,0 @@ - 'bar', - )); - - $this->assertEquals('bar', $loader->load('foo')); - } - - public function testSetAndLoadTemplates() - { - $loader = new Mustache_Loader_ArrayLoader(array( - 'foo' => 'bar', - )); - $this->assertEquals('bar', $loader->load('foo')); - - $loader->setTemplate('baz', 'qux'); - $this->assertEquals('qux', $loader->load('baz')); - - $loader->setTemplates(array( - 'foo' => 'FOO', - 'baz' => 'BAZ', - )); - $this->assertEquals('FOO', $loader->load('foo')); - $this->assertEquals('BAZ', $loader->load('baz')); - } - - /** - * @expectedException Mustache_Exception_UnknownTemplateException - */ - public function testMissingTemplatesThrowExceptions() - { - $loader = new Mustache_Loader_ArrayLoader(); - $loader->load('not_a_real_template'); - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Loader/CascadingLoaderTest.php b/vendor/mustache/mustache/test/Mustache/Test/Loader/CascadingLoaderTest.php deleted file mode 100644 index ecf80d6f..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/Loader/CascadingLoaderTest.php +++ /dev/null @@ -1,40 +0,0 @@ - '{{ foo }}')), - new Mustache_Loader_ArrayLoader(array('bar' => '{{#bar}}BAR{{/bar}}')), - )); - - $this->assertEquals('{{ foo }}', $loader->load('foo')); - $this->assertEquals('{{#bar}}BAR{{/bar}}', $loader->load('bar')); - } - - /** - * @expectedException Mustache_Exception_UnknownTemplateException - */ - public function testMissingTemplatesThrowExceptions() - { - $loader = new Mustache_Loader_CascadingLoader(array( - new Mustache_Loader_ArrayLoader(array('foo' => '{{ foo }}')), - new Mustache_Loader_ArrayLoader(array('bar' => '{{#bar}}BAR{{/bar}}')), - )); - - $loader->load('not_a_real_template'); - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Loader/FilesystemLoaderTest.php b/vendor/mustache/mustache/test/Mustache/Test/Loader/FilesystemLoaderTest.php deleted file mode 100644 index 8c06e76b..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/Loader/FilesystemLoaderTest.php +++ /dev/null @@ -1,80 +0,0 @@ - '.ms')); - $this->assertEquals('alpha contents', $loader->load('alpha')); - $this->assertEquals('beta contents', $loader->load('beta.ms')); - } - - public function testTrailingSlashes() - { - $baseDir = dirname(__FILE__) . '/../../../fixtures/templates/'; - $loader = new Mustache_Loader_FilesystemLoader($baseDir); - $this->assertEquals('one contents', $loader->load('one')); - } - - public function testConstructorWithProtocol() - { - $baseDir = realpath(dirname(__FILE__) . '/../../../fixtures/templates'); - - $loader = new Mustache_Loader_FilesystemLoader('test://' . $baseDir, array('extension' => '.ms')); - $this->assertEquals('alpha contents', $loader->load('alpha')); - $this->assertEquals('beta contents', $loader->load('beta.ms')); - } - - public function testLoadTemplates() - { - $baseDir = realpath(dirname(__FILE__) . '/../../../fixtures/templates'); - $loader = new Mustache_Loader_FilesystemLoader($baseDir); - $this->assertEquals('one contents', $loader->load('one')); - $this->assertEquals('two contents', $loader->load('two.mustache')); - } - - public function testEmptyExtensionString() - { - $baseDir = realpath(dirname(__FILE__) . '/../../../fixtures/templates'); - - $loader = new Mustache_Loader_FilesystemLoader($baseDir, array('extension' => '')); - $this->assertEquals('one contents', $loader->load('one.mustache')); - $this->assertEquals('alpha contents', $loader->load('alpha.ms')); - - $loader = new Mustache_Loader_FilesystemLoader($baseDir, array('extension' => null)); - $this->assertEquals('two contents', $loader->load('two.mustache')); - $this->assertEquals('beta contents', $loader->load('beta.ms')); - } - - /** - * @expectedException Mustache_Exception_RuntimeException - */ - public function testMissingBaseDirThrowsException() - { - new Mustache_Loader_FilesystemLoader(dirname(__FILE__) . '/not_a_directory'); - } - - /** - * @expectedException Mustache_Exception_UnknownTemplateException - */ - public function testMissingTemplateThrowsException() - { - $baseDir = realpath(dirname(__FILE__) . '/../../../fixtures/templates'); - $loader = new Mustache_Loader_FilesystemLoader($baseDir); - - $loader->load('fake'); - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Loader/InlineLoaderTest.php b/vendor/mustache/mustache/test/Mustache/Test/Loader/InlineLoaderTest.php deleted file mode 100644 index 24f2e0b3..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/Loader/InlineLoaderTest.php +++ /dev/null @@ -1,56 +0,0 @@ -assertEquals('{{ foo }}', $loader->load('foo')); - $this->assertEquals('{{#bar}}BAR{{/bar}}', $loader->load('bar')); - } - - /** - * @expectedException Mustache_Exception_UnknownTemplateException - */ - public function testMissingTemplatesThrowExceptions() - { - $loader = new Mustache_Loader_InlineLoader(__FILE__, __COMPILER_HALT_OFFSET__); - $loader->load('not_a_real_template'); - } - - /** - * @expectedException Mustache_Exception_InvalidArgumentException - */ - public function testInvalidOffsetThrowsException() - { - new Mustache_Loader_InlineLoader(__FILE__, 'notanumber'); - } - - /** - * @expectedException Mustache_Exception_InvalidArgumentException - */ - public function testInvalidFileThrowsException() - { - new Mustache_Loader_InlineLoader('notarealfile', __COMPILER_HALT_OFFSET__); - } -} - -__halt_compiler(); - -@@ foo -{{ foo }} - -@@ bar -{{#bar}}BAR{{/bar}} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Loader/ProductionFilesystemLoaderTest.php b/vendor/mustache/mustache/test/Mustache/Test/Loader/ProductionFilesystemLoaderTest.php deleted file mode 100644 index 0c7c7e30..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/Loader/ProductionFilesystemLoaderTest.php +++ /dev/null @@ -1,103 +0,0 @@ - '.ms')); - $this->assertInstanceOf('Mustache_Source', $loader->load('alpha')); - $this->assertEquals('alpha contents', $loader->load('alpha')->getSource()); - $this->assertInstanceOf('Mustache_Source', $loader->load('beta.ms')); - $this->assertEquals('beta contents', $loader->load('beta.ms')->getSource()); - } - - public function testTrailingSlashes() - { - $baseDir = dirname(__FILE__) . '/../../../fixtures/templates/'; - $loader = new Mustache_Loader_ProductionFilesystemLoader($baseDir); - $this->assertEquals('one contents', $loader->load('one')->getSource()); - } - - public function testConstructorWithProtocol() - { - $baseDir = realpath(dirname(__FILE__) . '/../../../fixtures/templates'); - - $loader = new Mustache_Loader_ProductionFilesystemLoader('file://' . $baseDir, array('extension' => '.ms')); - $this->assertEquals('alpha contents', $loader->load('alpha')->getSource()); - $this->assertEquals('beta contents', $loader->load('beta.ms')->getSource()); - } - - public function testLoadTemplates() - { - $baseDir = realpath(dirname(__FILE__) . '/../../../fixtures/templates'); - $loader = new Mustache_Loader_ProductionFilesystemLoader($baseDir); - $this->assertEquals('one contents', $loader->load('one')->getSource()); - $this->assertEquals('two contents', $loader->load('two.mustache')->getSource()); - } - - public function testEmptyExtensionString() - { - $baseDir = realpath(dirname(__FILE__) . '/../../../fixtures/templates'); - - $loader = new Mustache_Loader_ProductionFilesystemLoader($baseDir, array('extension' => '')); - $this->assertEquals('one contents', $loader->load('one.mustache')->getSource()); - $this->assertEquals('alpha contents', $loader->load('alpha.ms')->getSource()); - - $loader = new Mustache_Loader_ProductionFilesystemLoader($baseDir, array('extension' => null)); - $this->assertEquals('two contents', $loader->load('two.mustache')->getSource()); - $this->assertEquals('beta contents', $loader->load('beta.ms')->getSource()); - } - - /** - * @expectedException Mustache_Exception_RuntimeException - */ - public function testMissingBaseDirThrowsException() - { - new Mustache_Loader_ProductionFilesystemLoader(dirname(__FILE__) . '/not_a_directory'); - } - - /** - * @expectedException Mustache_Exception_UnknownTemplateException - */ - public function testMissingTemplateThrowsException() - { - $baseDir = realpath(dirname(__FILE__) . '/../../../fixtures/templates'); - $loader = new Mustache_Loader_ProductionFilesystemLoader($baseDir); - - $loader->load('fake'); - } - - public function testLoadWithDifferentStatProps() - { - $baseDir = realpath(dirname(__FILE__) . '/../../../fixtures/templates'); - $noStatLoader = new Mustache_Loader_ProductionFilesystemLoader($baseDir, array('stat_props' => null)); - $mtimeLoader = new Mustache_Loader_ProductionFilesystemLoader($baseDir, array('stat_props' => array('mtime'))); - $sizeLoader = new Mustache_Loader_ProductionFilesystemLoader($baseDir, array('stat_props' => array('size'))); - $bothLoader = new Mustache_Loader_ProductionFilesystemLoader($baseDir, array('stat_props' => array('mtime', 'size'))); - - $noStatKey = $noStatLoader->load('one.mustache')->getKey(); - $mtimeKey = $mtimeLoader->load('one.mustache')->getKey(); - $sizeKey = $sizeLoader->load('one.mustache')->getKey(); - $bothKey = $bothLoader->load('one.mustache')->getKey(); - - $this->assertNotEquals($noStatKey, $mtimeKey); - $this->assertNotEquals($noStatKey, $sizeKey); - $this->assertNotEquals($noStatKey, $bothKey); - $this->assertNotEquals($mtimeKey, $sizeKey); - $this->assertNotEquals($mtimeKey, $bothKey); - $this->assertNotEquals($sizeKey, $bothKey); - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Loader/StringLoaderTest.php b/vendor/mustache/mustache/test/Mustache/Test/Loader/StringLoaderTest.php deleted file mode 100644 index 5896f00b..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/Loader/StringLoaderTest.php +++ /dev/null @@ -1,25 +0,0 @@ -assertEquals('foo', $loader->load('foo')); - $this->assertEquals('{{ bar }}', $loader->load('{{ bar }}')); - $this->assertEquals("\n{{! comment }}\n", $loader->load("\n{{! comment }}\n")); - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Logger/AbstractLoggerTest.php b/vendor/mustache/mustache/test/Mustache/Test/Logger/AbstractLoggerTest.php deleted file mode 100644 index 19dc27cd..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/Logger/AbstractLoggerTest.php +++ /dev/null @@ -1,60 +0,0 @@ -emergency('emergency message'); - $logger->alert('alert message'); - $logger->critical('critical message'); - $logger->error('error message'); - $logger->warning('warning message'); - $logger->notice('notice message'); - $logger->info('info message'); - $logger->debug('debug message'); - - $expected = array( - array(Mustache_Logger::EMERGENCY, 'emergency message', array()), - array(Mustache_Logger::ALERT, 'alert message', array()), - array(Mustache_Logger::CRITICAL, 'critical message', array()), - array(Mustache_Logger::ERROR, 'error message', array()), - array(Mustache_Logger::WARNING, 'warning message', array()), - array(Mustache_Logger::NOTICE, 'notice message', array()), - array(Mustache_Logger::INFO, 'info message', array()), - array(Mustache_Logger::DEBUG, 'debug message', array()), - ); - - $this->assertEquals($expected, $logger->log); - } -} - -class Mustache_Test_Logger_TestLogger extends Mustache_Logger_AbstractLogger -{ - public $log = array(); - - /** - * Logs with an arbitrary level. - * - * @param mixed $level - * @param string $message - * @param array $context - */ - public function log($level, $message, array $context = array()) - { - $this->log[] = array($level, $message, $context); - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Logger/StreamLoggerTest.php b/vendor/mustache/mustache/test/Mustache/Test/Logger/StreamLoggerTest.php deleted file mode 100644 index fc1a06f1..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/Logger/StreamLoggerTest.php +++ /dev/null @@ -1,209 +0,0 @@ -log(Mustache_Logger::CRITICAL, 'message'); - - $this->assertEquals("CRITICAL: message\n", file_get_contents($name)); - } - - public function acceptsStreamData() - { - $one = tempnam(sys_get_temp_dir(), 'mustache-test'); - $two = tempnam(sys_get_temp_dir(), 'mustache-test'); - - return array( - array($one, $one), - array($two, fopen($two, 'a')), - ); - } - - /** - * @expectedException Mustache_Exception_LogicException - */ - public function testPrematurelyClosedStreamThrowsException() - { - $stream = tmpfile(); - $logger = new Mustache_Logger_StreamLogger($stream); - fclose($stream); - - $logger->log(Mustache_Logger::CRITICAL, 'message'); - } - - /** - * @dataProvider getLevels - */ - public function testLoggingThresholds($logLevel, $level, $shouldLog) - { - $stream = tmpfile(); - $logger = new Mustache_Logger_StreamLogger($stream, $logLevel); - $logger->log($level, 'logged'); - - rewind($stream); - $result = fread($stream, 1024); - - if ($shouldLog) { - $this->assertContains('logged', $result); - } else { - $this->assertEmpty($result); - } - } - - public function getLevels() - { - // $logLevel, $level, $shouldLog - return array( - // identities - array(Mustache_Logger::EMERGENCY, Mustache_Logger::EMERGENCY, true), - array(Mustache_Logger::ALERT, Mustache_Logger::ALERT, true), - array(Mustache_Logger::CRITICAL, Mustache_Logger::CRITICAL, true), - array(Mustache_Logger::ERROR, Mustache_Logger::ERROR, true), - array(Mustache_Logger::WARNING, Mustache_Logger::WARNING, true), - array(Mustache_Logger::NOTICE, Mustache_Logger::NOTICE, true), - array(Mustache_Logger::INFO, Mustache_Logger::INFO, true), - array(Mustache_Logger::DEBUG, Mustache_Logger::DEBUG, true), - - // one above - array(Mustache_Logger::ALERT, Mustache_Logger::EMERGENCY, true), - array(Mustache_Logger::CRITICAL, Mustache_Logger::ALERT, true), - array(Mustache_Logger::ERROR, Mustache_Logger::CRITICAL, true), - array(Mustache_Logger::WARNING, Mustache_Logger::ERROR, true), - array(Mustache_Logger::NOTICE, Mustache_Logger::WARNING, true), - array(Mustache_Logger::INFO, Mustache_Logger::NOTICE, true), - array(Mustache_Logger::DEBUG, Mustache_Logger::INFO, true), - - // one below - array(Mustache_Logger::EMERGENCY, Mustache_Logger::ALERT, false), - array(Mustache_Logger::ALERT, Mustache_Logger::CRITICAL, false), - array(Mustache_Logger::CRITICAL, Mustache_Logger::ERROR, false), - array(Mustache_Logger::ERROR, Mustache_Logger::WARNING, false), - array(Mustache_Logger::WARNING, Mustache_Logger::NOTICE, false), - array(Mustache_Logger::NOTICE, Mustache_Logger::INFO, false), - array(Mustache_Logger::INFO, Mustache_Logger::DEBUG, false), - ); - } - - /** - * @dataProvider getLogMessages - */ - public function testLogging($level, $message, $context, $expected) - { - $stream = tmpfile(); - $logger = new Mustache_Logger_StreamLogger($stream, Mustache_Logger::DEBUG); - $logger->log($level, $message, $context); - - rewind($stream); - $result = fread($stream, 1024); - - $this->assertEquals($expected, $result); - } - - public function getLogMessages() - { - // $level, $message, $context, $expected - return array( - array(Mustache_Logger::DEBUG, 'debug message', array(), "DEBUG: debug message\n"), - array(Mustache_Logger::INFO, 'info message', array(), "INFO: info message\n"), - array(Mustache_Logger::NOTICE, 'notice message', array(), "NOTICE: notice message\n"), - array(Mustache_Logger::WARNING, 'warning message', array(), "WARNING: warning message\n"), - array(Mustache_Logger::ERROR, 'error message', array(), "ERROR: error message\n"), - array(Mustache_Logger::CRITICAL, 'critical message', array(), "CRITICAL: critical message\n"), - array(Mustache_Logger::ALERT, 'alert message', array(), "ALERT: alert message\n"), - array(Mustache_Logger::EMERGENCY, 'emergency message', array(), "EMERGENCY: emergency message\n"), - - // with context - array( - Mustache_Logger::ERROR, - 'error message', - array('name' => 'foo', 'number' => 42), - "ERROR: error message\n", - ), - - // with interpolation - array( - Mustache_Logger::ERROR, - 'error {name}-{number}', - array('name' => 'foo', 'number' => 42), - "ERROR: error foo-42\n", - ), - - // with iterpolation false positive - array( - Mustache_Logger::ERROR, - 'error {nothing}', - array('name' => 'foo', 'number' => 42), - "ERROR: error {nothing}\n", - ), - - // with interpolation injection - array( - Mustache_Logger::ERROR, - '{foo}', - array('foo' => '{bar}', 'bar' => 'FAIL'), - "ERROR: {bar}\n", - ), - ); - } - - public function testChangeLoggingLevels() - { - $stream = tmpfile(); - $logger = new Mustache_Logger_StreamLogger($stream); - - $logger->setLevel(Mustache_Logger::ERROR); - $this->assertEquals(Mustache_Logger::ERROR, $logger->getLevel()); - - $logger->log(Mustache_Logger::WARNING, 'ignore this'); - - $logger->setLevel(Mustache_Logger::INFO); - $this->assertEquals(Mustache_Logger::INFO, $logger->getLevel()); - - $logger->log(Mustache_Logger::WARNING, 'log this'); - - $logger->setLevel(Mustache_Logger::CRITICAL); - $this->assertEquals(Mustache_Logger::CRITICAL, $logger->getLevel()); - - $logger->log(Mustache_Logger::ERROR, 'ignore this'); - - rewind($stream); - $result = fread($stream, 1024); - - $this->assertEquals("WARNING: log this\n", $result); - } - - /** - * @expectedException Mustache_Exception_InvalidArgumentException - */ - public function testThrowsInvalidArgumentExceptionWhenSettingUnknownLevels() - { - $logger = new Mustache_Logger_StreamLogger(tmpfile()); - $logger->setLevel('bacon'); - } - - /** - * @expectedException Mustache_Exception_InvalidArgumentException - */ - public function testThrowsInvalidArgumentExceptionWhenLoggingUnknownLevels() - { - $logger = new Mustache_Logger_StreamLogger(tmpfile()); - $logger->log('bacon', 'CODE BACON ERROR!'); - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/ParserTest.php b/vendor/mustache/mustache/test/Mustache/Test/ParserTest.php deleted file mode 100644 index d8458f76..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/ParserTest.php +++ /dev/null @@ -1,425 +0,0 @@ -assertEquals($expected, $parser->parse($tokens)); - } - - public function getTokenSets() - { - return array( - array( - array(), - array(), - ), - - array( - array(array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::VALUE => 'text', - )), - array(array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::VALUE => 'text', - )), - ), - - array( - array(array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::NAME => 'name', - )), - array(array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::NAME => 'name', - )), - ), - - array( - array( - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::VALUE => 'foo', - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_INVERTED, - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::INDEX => 123, - Mustache_Tokenizer::NAME => 'parent', - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::NAME => 'name', - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_END_SECTION, - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::INDEX => 456, - Mustache_Tokenizer::NAME => 'parent', - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::VALUE => 'bar', - ), - ), - - array( - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::VALUE => 'foo', - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_INVERTED, - Mustache_Tokenizer::NAME => 'parent', - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::INDEX => 123, - Mustache_Tokenizer::END => 456, - Mustache_Tokenizer::NODES => array( - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::NAME => 'name', - ), - ), - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::VALUE => 'bar', - ), - ), - ), - - // This *would* be an invalid inheritance parse tree, but that pragma - // isn't enabled so it'll thunk it back into an "escaped" token: - array( - array( - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_BLOCK_VAR, - Mustache_Tokenizer::NAME => 'foo', - Mustache_Tokenizer::OTAG => '{{', - Mustache_Tokenizer::CTAG => '}}', - Mustache_Tokenizer::LINE => 0, - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::VALUE => 'bar', - ), - ), - array( - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, - Mustache_Tokenizer::NAME => '$foo', - Mustache_Tokenizer::OTAG => '{{', - Mustache_Tokenizer::CTAG => '}}', - Mustache_Tokenizer::LINE => 0, - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::VALUE => 'bar', - ), - ), - ), - - array( - array( - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::VALUE => ' ', - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_DELIM_CHANGE, - Mustache_Tokenizer::LINE => 0, - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::VALUE => " \n", - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, - Mustache_Tokenizer::NAME => 'foo', - Mustache_Tokenizer::OTAG => '[[', - Mustache_Tokenizer::CTAG => ']]', - Mustache_Tokenizer::LINE => 1, - ), - ), - array( - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, - Mustache_Tokenizer::NAME => 'foo', - Mustache_Tokenizer::OTAG => '[[', - Mustache_Tokenizer::CTAG => ']]', - Mustache_Tokenizer::LINE => 1, - ), - ), - ), - - ); - } - - /** - * @dataProvider getInheritanceTokenSets - */ - public function testParseWithInheritance($tokens, $expected) - { - $parser = new Mustache_Parser(); - $parser->setPragmas(array(Mustache_Engine::PRAGMA_BLOCKS)); - $this->assertEquals($expected, $parser->parse($tokens)); - } - - public function getInheritanceTokenSets() - { - return array( - array( - array( - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_PARENT, - Mustache_Tokenizer::NAME => 'foo', - Mustache_Tokenizer::OTAG => '{{', - Mustache_Tokenizer::CTAG => '}}', - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::INDEX => 8, - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_BLOCK_VAR, - Mustache_Tokenizer::NAME => 'bar', - Mustache_Tokenizer::OTAG => '{{', - Mustache_Tokenizer::CTAG => '}}', - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::INDEX => 16, - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::VALUE => 'baz', - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_END_SECTION, - Mustache_Tokenizer::NAME => 'bar', - Mustache_Tokenizer::OTAG => '{{', - Mustache_Tokenizer::CTAG => '}}', - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::INDEX => 19, - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_END_SECTION, - Mustache_Tokenizer::NAME => 'foo', - Mustache_Tokenizer::OTAG => '{{', - Mustache_Tokenizer::CTAG => '}}', - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::INDEX => 27, - ), - ), - array( - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_PARENT, - Mustache_Tokenizer::NAME => 'foo', - Mustache_Tokenizer::OTAG => '{{', - Mustache_Tokenizer::CTAG => '}}', - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::INDEX => 8, - Mustache_Tokenizer::END => 27, - Mustache_Tokenizer::NODES => array( - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_BLOCK_ARG, - Mustache_Tokenizer::NAME => 'bar', - Mustache_Tokenizer::OTAG => '{{', - Mustache_Tokenizer::CTAG => '}}', - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::INDEX => 16, - Mustache_Tokenizer::END => 19, - Mustache_Tokenizer::NODES => array( - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::VALUE => 'baz', - ), - ), - ), - ), - ), - ), - ), - - array( - array( - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_BLOCK_VAR, - Mustache_Tokenizer::NAME => 'foo', - Mustache_Tokenizer::OTAG => '{{', - Mustache_Tokenizer::CTAG => '}}', - Mustache_Tokenizer::LINE => 0, - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::VALUE => 'bar', - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_END_SECTION, - Mustache_Tokenizer::NAME => 'foo', - Mustache_Tokenizer::OTAG => '{{', - Mustache_Tokenizer::CTAG => '}}', - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::INDEX => 11, - ), - ), - array( - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_BLOCK_VAR, - Mustache_Tokenizer::NAME => 'foo', - Mustache_Tokenizer::OTAG => '{{', - Mustache_Tokenizer::CTAG => '}}', - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::END => 11, - Mustache_Tokenizer::NODES => array( - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::VALUE => 'bar', - ), - ), - ), - ), - ), - ); - } - - /** - * @dataProvider getBadParseTrees - * @expectedException Mustache_Exception_SyntaxException - */ - public function testParserThrowsExceptions($tokens) - { - $parser = new Mustache_Parser(); - $parser->parse($tokens); - } - - public function getBadParseTrees() - { - return array( - // no close - array( - array( - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_SECTION, - Mustache_Tokenizer::NAME => 'parent', - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::INDEX => 123, - ), - ), - ), - - // no close inverted - array( - array( - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_INVERTED, - Mustache_Tokenizer::NAME => 'parent', - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::INDEX => 123, - ), - ), - ), - - // no opening inverted - array( - array( - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_END_SECTION, - Mustache_Tokenizer::NAME => 'parent', - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::INDEX => 123, - ), - ), - ), - - // weird nesting - array( - array( - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_SECTION, - Mustache_Tokenizer::NAME => 'parent', - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::INDEX => 123, - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_SECTION, - Mustache_Tokenizer::NAME => 'child', - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::INDEX => 123, - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_END_SECTION, - Mustache_Tokenizer::NAME => 'parent', - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::INDEX => 123, - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_END_SECTION, - Mustache_Tokenizer::NAME => 'child', - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::INDEX => 123, - ), - ), - ), - - // This *would* be a valid inheritance parse tree, but that pragma - // isn't enabled here so it's going to fail :) - array( - array( - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_BLOCK_VAR, - Mustache_Tokenizer::NAME => 'foo', - Mustache_Tokenizer::OTAG => '{{', - Mustache_Tokenizer::CTAG => '}}', - Mustache_Tokenizer::LINE => 0, - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::VALUE => 'bar', - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_END_SECTION, - Mustache_Tokenizer::NAME => 'foo', - Mustache_Tokenizer::OTAG => '{{', - Mustache_Tokenizer::CTAG => '}}', - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::INDEX => 11, - ), - ), - ), - ); - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/Source/FilesystemSourceTest.php b/vendor/mustache/mustache/test/Mustache/Test/Source/FilesystemSourceTest.php deleted file mode 100644 index a636ffe5..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/Source/FilesystemSourceTest.php +++ /dev/null @@ -1,25 +0,0 @@ -getKey(); - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/SpecTestCase.php b/vendor/mustache/mustache/test/Mustache/Test/SpecTestCase.php deleted file mode 100644 index db188dea..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/SpecTestCase.php +++ /dev/null @@ -1,67 +0,0 @@ -setPartials($partials); - - return self::$mustache->loadTemplate($source); - } - - /** - * Data provider for the mustache spec test. - * - * Loads YAML files from the spec and converts them to PHPisms. - * - * @param string $name - * - * @return array - */ - protected function loadSpec($name) - { - $filename = dirname(__FILE__) . '/../../../vendor/spec/specs/' . $name . '.yml'; - if (!file_exists($filename)) { - return array(); - } - - $data = array(); - $yaml = new sfYamlParser(); - $file = file_get_contents($filename); - - // @hack: pre-process the 'lambdas' spec so the Symfony YAML parser doesn't complain. - if ($name === '~lambdas') { - $file = str_replace(" !code\n", "\n", $file); - } - - $spec = $yaml->parse($file); - - foreach ($spec['tests'] as $test) { - $data[] = array( - $test['name'] . ': ' . $test['desc'], - $test['template'], - isset($test['partials']) ? $test['partials'] : array(), - $test['data'], - $test['expected'], - ); - } - - return $data; - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/TemplateTest.php b/vendor/mustache/mustache/test/Mustache/Test/TemplateTest.php deleted file mode 100644 index 60065aad..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/TemplateTest.php +++ /dev/null @@ -1,55 +0,0 @@ -assertSame($mustache, $template->getMustache()); - } - - public function testRendering() - { - $rendered = '<< wheee >>'; - $mustache = new Mustache_Engine(); - $template = new Mustache_Test_TemplateStub($mustache); - $template->rendered = $rendered; - $context = new Mustache_Context(); - - if (version_compare(PHP_VERSION, '5.3.0', '>=')) { - $this->assertEquals($rendered, $template()); - } - - $this->assertEquals($rendered, $template->render()); - $this->assertEquals($rendered, $template->renderInternal($context)); - $this->assertEquals($rendered, $template->render(array('foo' => 'bar'))); - } -} - -class Mustache_Test_TemplateStub extends Mustache_Template -{ - public $rendered; - - public function getMustache() - { - return $this->mustache; - } - - public function renderInternal(Mustache_Context $context, $indent = '', $escape = false) - { - return $this->rendered; - } -} diff --git a/vendor/mustache/mustache/test/Mustache/Test/TokenizerTest.php b/vendor/mustache/mustache/test/Mustache/Test/TokenizerTest.php deleted file mode 100644 index 38f16dc4..00000000 --- a/vendor/mustache/mustache/test/Mustache/Test/TokenizerTest.php +++ /dev/null @@ -1,306 +0,0 @@ -assertSame($expected, $tokenizer->scan($text, $delimiters)); - } - - /** - * @expectedException Mustache_Exception_SyntaxException - */ - public function testUnevenBracesThrowExceptions() - { - $tokenizer = new Mustache_Tokenizer(); - - $text = '{{{ name }}'; - $tokenizer->scan($text, null); - } - - /** - * @expectedException Mustache_Exception_SyntaxException - */ - public function testUnevenBracesWithCustomDelimiterThrowExceptions() - { - $tokenizer = new Mustache_Tokenizer(); - - $text = '<%{ name %>'; - $tokenizer->scan($text, '<% %>'); - } - - public function getTokens() - { - return array( - array( - 'text', - null, - array( - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::VALUE => 'text', - ), - ), - ), - - array( - 'text', - '<<< >>>', - array( - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::VALUE => 'text', - ), - ), - ), - - array( - '{{ name }}', - null, - array( - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, - Mustache_Tokenizer::NAME => 'name', - Mustache_Tokenizer::OTAG => '{{', - Mustache_Tokenizer::CTAG => '}}', - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::INDEX => 10, - ), - ), - ), - - array( - '{{ name }}', - '<<< >>>', - array( - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::VALUE => '{{ name }}', - ), - ), - ), - - array( - '<<< name >>>', - '<<< >>>', - array( - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, - Mustache_Tokenizer::NAME => 'name', - Mustache_Tokenizer::OTAG => '<<<', - Mustache_Tokenizer::CTAG => '>>>', - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::INDEX => 12, - ), - ), - ), - - array( - "{{{ a }}}\n{{# b }} \n{{= | | =}}| c ||/ b |\n|{ d }|", - null, - array( - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_UNESCAPED, - Mustache_Tokenizer::NAME => 'a', - Mustache_Tokenizer::OTAG => '{{', - Mustache_Tokenizer::CTAG => '}}', - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::INDEX => 8, - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::VALUE => "\n", - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_SECTION, - Mustache_Tokenizer::NAME => 'b', - Mustache_Tokenizer::OTAG => '{{', - Mustache_Tokenizer::CTAG => '}}', - Mustache_Tokenizer::LINE => 1, - Mustache_Tokenizer::INDEX => 18, - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, - Mustache_Tokenizer::LINE => 1, - Mustache_Tokenizer::VALUE => " \n", - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_DELIM_CHANGE, - Mustache_Tokenizer::LINE => 2, - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, - Mustache_Tokenizer::NAME => 'c', - Mustache_Tokenizer::OTAG => '|', - Mustache_Tokenizer::CTAG => '|', - Mustache_Tokenizer::LINE => 2, - Mustache_Tokenizer::INDEX => 37, - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_END_SECTION, - Mustache_Tokenizer::NAME => 'b', - Mustache_Tokenizer::OTAG => '|', - Mustache_Tokenizer::CTAG => '|', - Mustache_Tokenizer::LINE => 2, - Mustache_Tokenizer::INDEX => 37, - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, - Mustache_Tokenizer::LINE => 2, - Mustache_Tokenizer::VALUE => "\n", - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_UNESCAPED, - Mustache_Tokenizer::NAME => 'd', - Mustache_Tokenizer::OTAG => '|', - Mustache_Tokenizer::CTAG => '|', - Mustache_Tokenizer::LINE => 3, - Mustache_Tokenizer::INDEX => 51, - ), - - ), - ), - - // See https://github.com/bobthecow/mustache.php/issues/183 - array( - '{{# a }}0{{/ a }}', - null, - array( - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_SECTION, - Mustache_Tokenizer::NAME => 'a', - Mustache_Tokenizer::OTAG => '{{', - Mustache_Tokenizer::CTAG => '}}', - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::INDEX => 8, - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::VALUE => '0', - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_END_SECTION, - Mustache_Tokenizer::NAME => 'a', - Mustache_Tokenizer::OTAG => '{{', - Mustache_Tokenizer::CTAG => '}}', - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::INDEX => 9, - ), - ), - ), - - // custom delimiters don't swallow the next character, even if it is a }, }}}, or the same delimiter - array( - '<% a %>} <% b %>%> <% c %>}}}', - '<% %>', - array( - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, - Mustache_Tokenizer::NAME => 'a', - Mustache_Tokenizer::OTAG => '<%', - Mustache_Tokenizer::CTAG => '%>', - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::INDEX => 7, - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::VALUE => '} ', - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, - Mustache_Tokenizer::NAME => 'b', - Mustache_Tokenizer::OTAG => '<%', - Mustache_Tokenizer::CTAG => '%>', - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::INDEX => 16, - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::VALUE => '%> ', - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_ESCAPED, - Mustache_Tokenizer::NAME => 'c', - Mustache_Tokenizer::OTAG => '<%', - Mustache_Tokenizer::CTAG => '%>', - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::INDEX => 26, - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::VALUE => '}}}', - ), - ), - ), - - // unescaped custom delimiters are properly parsed - array( - '<%{ a }%>', - '<% %>', - array( - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_UNESCAPED, - Mustache_Tokenizer::NAME => 'a', - Mustache_Tokenizer::OTAG => '<%', - Mustache_Tokenizer::CTAG => '%>', - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::INDEX => 9, - ), - ), - ), - - // Ensure that $arg token is not picked up during tokenization - array( - '{{$arg}}default{{/arg}}', - null, - array( - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_BLOCK_VAR, - Mustache_Tokenizer::NAME => 'arg', - Mustache_Tokenizer::OTAG => '{{', - Mustache_Tokenizer::CTAG => '}}', - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::INDEX => 8, - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT, - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::VALUE => 'default', - ), - array( - Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_END_SECTION, - Mustache_Tokenizer::NAME => 'arg', - Mustache_Tokenizer::OTAG => '{{', - Mustache_Tokenizer::CTAG => '}}', - Mustache_Tokenizer::LINE => 0, - Mustache_Tokenizer::INDEX => 15, - ), - ), - ), - ); - } -} diff --git a/vendor/mustache/mustache/test/bootstrap.php b/vendor/mustache/mustache/test/bootstrap.php deleted file mode 100644 index b3d0a199..00000000 --- a/vendor/mustache/mustache/test/bootstrap.php +++ /dev/null @@ -1,91 +0,0 @@ -filehandle = fopen($path, $mode); - - return $this->filehandle !== false; - } - - /** - * @return array - */ - public function stream_stat() - { - return array(); - } - - /** - * @param int $count - * - * @return string - */ - public function stream_read($count) - { - return fgets($this->filehandle, $count); - } - - /** - * @return bool - */ - public function stream_eof() - { - return feof($this->filehandle); - } - - /** - * @return bool - */ - public function stream_close() - { - return fclose($this->filehandle); - } -} - -if (!stream_wrapper_register('test', 'TestStream')) { - die('Failed to register protocol'); -} diff --git a/vendor/mustache/mustache/test/fixtures/autoloader/Mustache/Bar.php b/vendor/mustache/mustache/test/fixtures/autoloader/Mustache/Bar.php deleted file mode 100644 index 35c2668b..00000000 --- a/vendor/mustache/mustache/test/fixtures/autoloader/Mustache/Bar.php +++ /dev/null @@ -1,15 +0,0 @@ - 'Punk', - 'subgenres' => array( - array( - 'name' => 'Hardcore', - 'subgenres' => array( - array( - 'name' => 'First wave of black metal', - 'subgenres' => array( - array('name' => 'Norwegian black metal'), - array( - 'name' => 'Death metal', - 'subgenres' => array( - array( - 'name' => 'Swedish death metal', - 'subgenres' => array( - array('name' => 'New wave of American metal'), - ), - ), - ), - ), - ), - ), - array( - 'name' => 'Thrash metal', - 'subgenres' => array( - array('name' => 'Grindcore'), - array( - 'name' => 'Metalcore', - 'subgenres' => array( - array('name' => 'Nu metal'), - ), - ), - ), - ), - ), - ), - ), - ), - ); -} diff --git a/vendor/mustache/mustache/test/fixtures/examples/anchored_dot_notation/anchored_dot_notation.mustache b/vendor/mustache/mustache/test/fixtures/examples/anchored_dot_notation/anchored_dot_notation.mustache deleted file mode 100644 index 9494fb10..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/anchored_dot_notation/anchored_dot_notation.mustache +++ /dev/null @@ -1,4 +0,0 @@ -{{% ANCHORED-DOT }} -{{# genres }} -{{> genre }} -{{/ genres }} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/anchored_dot_notation/anchored_dot_notation.txt b/vendor/mustache/mustache/test/fixtures/examples/anchored_dot_notation/anchored_dot_notation.txt deleted file mode 100644 index fa56efc9..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/anchored_dot_notation/anchored_dot_notation.txt +++ /dev/null @@ -1,11 +0,0 @@ - - Punk - - Hardcore - - First wave of black metal - - Norwegian black metal - - Death metal - - Swedish death metal - - New wave of American metal - - Thrash metal - - Grindcore - - Metalcore - - Nu metal diff --git a/vendor/mustache/mustache/test/fixtures/examples/anchored_dot_notation/partials/genre.mustache b/vendor/mustache/mustache/test/fixtures/examples/anchored_dot_notation/partials/genre.mustache deleted file mode 100644 index f51c503b..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/anchored_dot_notation/partials/genre.mustache +++ /dev/null @@ -1,5 +0,0 @@ -{{% ANCHORED-DOT }} - - {{ name }} -{{# .subgenres }} - {{> genre }} -{{/ .subgenres }} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/blocks/Blocks.php b/vendor/mustache/mustache/test/fixtures/examples/blocks/Blocks.php deleted file mode 100644 index 6362aca2..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/blocks/Blocks.php +++ /dev/null @@ -1,15 +0,0 @@ - 'child works', - ); - - public $grandparent = array( - 'parent' => array( - 'child' => 'grandchild works', - ), - ); -} diff --git a/vendor/mustache/mustache/test/fixtures/examples/child_context/child_context.mustache b/vendor/mustache/mustache/test/fixtures/examples/child_context/child_context.mustache deleted file mode 100644 index e1f2ebcb..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/child_context/child_context.mustache +++ /dev/null @@ -1,2 +0,0 @@ -

{{#parent}}{{child}}{{/parent}}

-

{{#grandparent}}{{#parent}}{{child}}{{/parent}}{{/grandparent}}

\ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/child_context/child_context.txt b/vendor/mustache/mustache/test/fixtures/examples/child_context/child_context.txt deleted file mode 100644 index cfb76bf7..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/child_context/child_context.txt +++ /dev/null @@ -1,2 +0,0 @@ -

child works

-

grandchild works

\ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/comments/Comments.php b/vendor/mustache/mustache/test/fixtures/examples/comments/Comments.php deleted file mode 100644 index 88fe821a..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/comments/Comments.php +++ /dev/null @@ -1,18 +0,0 @@ -{{title}}{{! just something interesting... #or ^not... }} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/comments/comments.txt b/vendor/mustache/mustache/test/fixtures/examples/comments/comments.txt deleted file mode 100644 index 9f40e77b..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/comments/comments.txt +++ /dev/null @@ -1 +0,0 @@ -

A Comedy of Errors

\ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/complex/complex.mustache b/vendor/mustache/mustache/test/fixtures/examples/complex/complex.mustache deleted file mode 100644 index 807c201e..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/complex/complex.mustache +++ /dev/null @@ -1,16 +0,0 @@ -

{{header}}

-{{#notEmpty}} -
    -{{#item}} -{{#current}} -
  • {{name}}
  • -{{/current}} -{{^current}} -
  • {{name}}
  • -{{/current}} -{{/item}} -
-{{/notEmpty}} -{{#isEmpty}} -

The list is empty.

-{{/isEmpty}} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/complex/complex.php b/vendor/mustache/mustache/test/fixtures/examples/complex/complex.php deleted file mode 100644 index 7c696153..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/complex/complex.php +++ /dev/null @@ -1,31 +0,0 @@ - 'red', 'current' => true, 'url' => '#Red'), - array('name' => 'green', 'current' => false, 'url' => '#Green'), - array('name' => 'blue', 'current' => false, 'url' => '#Blue'), - ); - - public function notEmpty() - { - return !($this->isEmpty()); - } - - public function isEmpty() - { - return count($this->item) === 0; - } -} diff --git a/vendor/mustache/mustache/test/fixtures/examples/complex/complex.txt b/vendor/mustache/mustache/test/fixtures/examples/complex/complex.txt deleted file mode 100644 index facee6df..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/complex/complex.txt +++ /dev/null @@ -1,6 +0,0 @@ -

Colors

- diff --git a/vendor/mustache/mustache/test/fixtures/examples/delimiters/Delimiters.php b/vendor/mustache/mustache/test/fixtures/examples/delimiters/Delimiters.php deleted file mode 100644 index 235a0886..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/delimiters/Delimiters.php +++ /dev/null @@ -1,25 +0,0 @@ - 'And it worked the second time.'), - array('item' => 'As well as the third.'), - ); - } - - public $final = 'Then, surprisingly, it worked the final time.'; -} diff --git a/vendor/mustache/mustache/test/fixtures/examples/delimiters/delimiters.mustache b/vendor/mustache/mustache/test/fixtures/examples/delimiters/delimiters.mustache deleted file mode 100644 index e9b0332b..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/delimiters/delimiters.mustache +++ /dev/null @@ -1,8 +0,0 @@ -{{=<% %>=}} -* <% start %> -<%=| |=%> -|# middle | -* | item | -|/ middle | -|={{ }}=| -* {{ final }} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/delimiters/delimiters.txt b/vendor/mustache/mustache/test/fixtures/examples/delimiters/delimiters.txt deleted file mode 100644 index e6b2d7af..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/delimiters/delimiters.txt +++ /dev/null @@ -1,4 +0,0 @@ -* It worked the first time. -* And it worked the second time. -* As well as the third. -* Then, surprisingly, it worked the final time. \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/dot_notation/DotNotation.php b/vendor/mustache/mustache/test/fixtures/examples/dot_notation/DotNotation.php deleted file mode 100644 index eadbf61d..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/dot_notation/DotNotation.php +++ /dev/null @@ -1,24 +0,0 @@ - array('first' => 'Chris', 'last' => 'Firescythe'), - 'age' => 24, - 'hometown' => array( - 'city' => 'Cincinnati', - 'state' => 'OH', - ), - ); - - public $normal = 'Normal'; -} diff --git a/vendor/mustache/mustache/test/fixtures/examples/dot_notation/dot_notation.mustache b/vendor/mustache/mustache/test/fixtures/examples/dot_notation/dot_notation.mustache deleted file mode 100644 index 0566867b..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/dot_notation/dot_notation.mustache +++ /dev/null @@ -1,4 +0,0 @@ -* {{person.name.first}} {{person.name.last}} -* {{person.age}} -* {{person.hometown.city}}, {{person.hometown.state}} -* {{normal}} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/dot_notation/dot_notation.txt b/vendor/mustache/mustache/test/fixtures/examples/dot_notation/dot_notation.txt deleted file mode 100644 index f8cf1fa1..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/dot_notation/dot_notation.txt +++ /dev/null @@ -1,4 +0,0 @@ -* Chris Firescythe -* 24 -* Cincinnati, OH -* Normal \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/double_section/DoubleSection.php b/vendor/mustache/mustache/test/fixtures/examples/double_section/DoubleSection.php deleted file mode 100644 index 1b3f6b66..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/double_section/DoubleSection.php +++ /dev/null @@ -1,20 +0,0 @@ - "Shark"'; -} diff --git a/vendor/mustache/mustache/test/fixtures/examples/escaped/escaped.mustache b/vendor/mustache/mustache/test/fixtures/examples/escaped/escaped.mustache deleted file mode 100644 index 8be4ccb6..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/escaped/escaped.mustache +++ /dev/null @@ -1 +0,0 @@ -

{{title}}

\ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/escaped/escaped.txt b/vendor/mustache/mustache/test/fixtures/examples/escaped/escaped.txt deleted file mode 100644 index 6ba3657e..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/escaped/escaped.txt +++ /dev/null @@ -1 +0,0 @@ -

"Bear" > "Shark"

\ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/filters/Filters.php b/vendor/mustache/mustache/test/fixtures/examples/filters/Filters.php deleted file mode 100644 index eb6e3b77..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/filters/Filters.php +++ /dev/null @@ -1,97 +0,0 @@ - 'Alabama', - 'ak' => 'Alaska', - 'az' => 'Arizona', - 'ar' => 'Arkansas', - 'ca' => 'California', - 'co' => 'Colorado', - 'ct' => 'Connecticut', - 'de' => 'Delaware', - 'fl' => 'Florida', - 'ga' => 'Georgia', - 'hi' => 'Hawaii', - 'id' => 'Idaho', - 'il' => 'Illinois', - 'in' => 'Indiana', - 'ia' => 'Iowa', - 'ks' => 'Kansas', - 'ky' => 'Kentucky', - 'la' => 'Louisiana', - 'me' => 'Maine', - 'md' => 'Maryland', - 'ma' => 'Massachusetts', - 'mi' => 'Michigan', - 'mn' => 'Minnesota', - 'ms' => 'Mississippi', - 'mo' => 'Missouri', - 'mt' => 'Montana', - 'ne' => 'Nebraska', - 'nv' => 'Nevada', - 'nh' => 'New Hampshire', - 'nj' => 'New Jersey', - 'nm' => 'New Mexico', - 'ny' => 'New York', - 'nc' => 'North Carolina', - 'nd' => 'North Dakota', - 'oh' => 'Ohio', - 'ok' => 'Oklahoma', - 'or' => 'Oregon', - 'pa' => 'Pennsylvania', - 'ri' => 'Rhode Island', - 'sc' => 'South Carolina', - 'sd' => 'South Dakota', - 'tn' => 'Tennessee', - 'tx' => 'Texas', - 'ut' => 'Utah', - 'vt' => 'Vermont', - 'va' => 'Virginia', - 'wa' => 'Washington', - 'wv' => 'West Virginia', - 'wi' => 'Wisconsin', - 'wy' => 'Wyoming', - ); - - // The next few functions are ugly, because they have to work in PHP 5.2... - // for everyone who doesn't have to support 5.2, please, for the love, make - // your ViewModel return closures rather than `array($this, '...')` - // - // :) - - public function upcase() - { - return array($this, '_upcase'); - } - - public function _upcase($val) - { - return strtoupper($val); - } - - public function eachPair() - { - return array($this, '_eachPair'); - } - - public function _eachPair($val) - { - $ret = array(); - foreach ($val as $key => $value) { - array_push($ret, compact('key', 'value')); - } - - return $ret; - } -} diff --git a/vendor/mustache/mustache/test/fixtures/examples/filters/filters.mustache b/vendor/mustache/mustache/test/fixtures/examples/filters/filters.mustache deleted file mode 100644 index 50f14653..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/filters/filters.mustache +++ /dev/null @@ -1,4 +0,0 @@ -{{%FILTERS}} -{{# states | eachPair }} -{{ key | upcase }}: {{ value }} -{{/ states }} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/filters/filters.txt b/vendor/mustache/mustache/test/fixtures/examples/filters/filters.txt deleted file mode 100644 index 67466fd5..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/filters/filters.txt +++ /dev/null @@ -1,50 +0,0 @@ -AL: Alabama -AK: Alaska -AZ: Arizona -AR: Arkansas -CA: California -CO: Colorado -CT: Connecticut -DE: Delaware -FL: Florida -GA: Georgia -HI: Hawaii -ID: Idaho -IL: Illinois -IN: Indiana -IA: Iowa -KS: Kansas -KY: Kentucky -LA: Louisiana -ME: Maine -MD: Maryland -MA: Massachusetts -MI: Michigan -MN: Minnesota -MS: Mississippi -MO: Missouri -MT: Montana -NE: Nebraska -NV: Nevada -NH: New Hampshire -NJ: New Jersey -NM: New Mexico -NY: New York -NC: North Carolina -ND: North Dakota -OH: Ohio -OK: Oklahoma -OR: Oregon -PA: Pennsylvania -RI: Rhode Island -SC: South Carolina -SD: South Dakota -TN: Tennessee -TX: Texas -UT: Utah -VT: Vermont -VA: Virginia -WA: Washington -WV: West Virginia -WI: Wisconsin -WY: Wyoming diff --git a/vendor/mustache/mustache/test/fixtures/examples/grand_parent_context/GrandParentContext.php b/vendor/mustache/mustache/test/fixtures/examples/grand_parent_context/GrandParentContext.php deleted file mode 100644 index 2ee0e428..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/grand_parent_context/GrandParentContext.php +++ /dev/null @@ -1,33 +0,0 @@ -parent_contexts[] = array('parent_id' => 'parent1', 'child_contexts' => array( - array('child_id' => 'parent1-child1'), - array('child_id' => 'parent1-child2'), - )); - - $parent2 = new stdClass(); - $parent2->parent_id = 'parent2'; - $parent2->child_contexts = array( - array('child_id' => 'parent2-child1'), - array('child_id' => 'parent2-child2'), - ); - - $this->parent_contexts[] = $parent2; - } -} diff --git a/vendor/mustache/mustache/test/fixtures/examples/grand_parent_context/grand_parent_context.mustache b/vendor/mustache/mustache/test/fixtures/examples/grand_parent_context/grand_parent_context.mustache deleted file mode 100644 index 6d03ddf6..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/grand_parent_context/grand_parent_context.mustache +++ /dev/null @@ -1,7 +0,0 @@ -{{grand_parent_id}} -{{#parent_contexts}} - {{parent_id}} ({{grand_parent_id}}) - {{#child_contexts}} - {{child_id}} ({{parent_id}} << {{grand_parent_id}}) - {{/child_contexts}} -{{/parent_contexts}} diff --git a/vendor/mustache/mustache/test/fixtures/examples/grand_parent_context/grand_parent_context.txt b/vendor/mustache/mustache/test/fixtures/examples/grand_parent_context/grand_parent_context.txt deleted file mode 100644 index 2687f849..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/grand_parent_context/grand_parent_context.txt +++ /dev/null @@ -1,7 +0,0 @@ -grand_parent1 - parent1 (grand_parent1) - parent1-child1 (parent1 << grand_parent1) - parent1-child2 (parent1 << grand_parent1) - parent2 (grand_parent1) - parent2-child1 (parent2 << grand_parent1) - parent2-child2 (parent2 << grand_parent1) diff --git a/vendor/mustache/mustache/test/fixtures/examples/i18n/I18n.php b/vendor/mustache/mustache/test/fixtures/examples/i18n/I18n.php deleted file mode 100644 index c36bf709..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/i18n/I18n.php +++ /dev/null @@ -1,30 +0,0 @@ - 'Hola.', - 'My name is {{ name }}.' => 'Me llamo {{ name }}.', - ); - - public static function __trans($text) - { - return isset(self::$dictionary[$text]) ? self::$dictionary[$text] : $text; - } -} diff --git a/vendor/mustache/mustache/test/fixtures/examples/i18n/i18n.mustache b/vendor/mustache/mustache/test/fixtures/examples/i18n/i18n.mustache deleted file mode 100644 index eef169b4..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/i18n/i18n.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#__}}Hello.{{/__}} {{#__}}My name is {{ name }}.{{/__}} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/i18n/i18n.txt b/vendor/mustache/mustache/test/fixtures/examples/i18n/i18n.txt deleted file mode 100644 index 650a71ac..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/i18n/i18n.txt +++ /dev/null @@ -1 +0,0 @@ -Hola. Me llamo Bob. \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/implicit_iterator/ImplicitIterator.php b/vendor/mustache/mustache/test/fixtures/examples/implicit_iterator/ImplicitIterator.php deleted file mode 100644 index 074f8f49..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/implicit_iterator/ImplicitIterator.php +++ /dev/null @@ -1,15 +0,0 @@ -{{name}} -{{/repo}} -{{^repo}} - No repos :( -{{/repo}} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/inverted_section/inverted_section.txt b/vendor/mustache/mustache/test/fixtures/examples/inverted_section/inverted_section.txt deleted file mode 100644 index 6ba5a990..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/inverted_section/inverted_section.txt +++ /dev/null @@ -1 +0,0 @@ - No repos :( diff --git a/vendor/mustache/mustache/test/fixtures/examples/nested_partials/NestedPartials.php b/vendor/mustache/mustache/test/fixtures/examples/nested_partials/NestedPartials.php deleted file mode 100644 index a2a2bb16..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/nested_partials/NestedPartials.php +++ /dev/null @@ -1,15 +0,0 @@ - - {{> second }} - \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/nested_partials/nested_partials.txt b/vendor/mustache/mustache/test/fixtures/examples/nested_partials/nested_partials.txt deleted file mode 100644 index 62776f97..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/nested_partials/nested_partials.txt +++ /dev/null @@ -1,7 +0,0 @@ - - - - FOURTH! - - - \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/nested_partials/partials/fourth.mustache b/vendor/mustache/mustache/test/fixtures/examples/nested_partials/partials/fourth.mustache deleted file mode 100644 index 727676fe..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/nested_partials/partials/fourth.mustache +++ /dev/null @@ -1 +0,0 @@ -{{ val }} diff --git a/vendor/mustache/mustache/test/fixtures/examples/nested_partials/partials/second.mustache b/vendor/mustache/mustache/test/fixtures/examples/nested_partials/partials/second.mustache deleted file mode 100644 index 83f33cf4..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/nested_partials/partials/second.mustache +++ /dev/null @@ -1,3 +0,0 @@ - - {{> third }} - diff --git a/vendor/mustache/mustache/test/fixtures/examples/nested_partials/partials/third.mustache b/vendor/mustache/mustache/test/fixtures/examples/nested_partials/partials/third.mustache deleted file mode 100644 index f33301a6..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/nested_partials/partials/third.mustache +++ /dev/null @@ -1,3 +0,0 @@ - - {{> fourth }} - diff --git a/vendor/mustache/mustache/test/fixtures/examples/partials/Partials.php b/vendor/mustache/mustache/test/fixtures/examples/partials/Partials.php deleted file mode 100644 index e91dc681..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/partials/Partials.php +++ /dev/null @@ -1,19 +0,0 @@ - 'Page Title', - 'subtitle' => 'Page Subtitle', - 'content' => 'Lorem ipsum dolor sit amet.', - ); -} diff --git a/vendor/mustache/mustache/test/fixtures/examples/partials/partials.mustache b/vendor/mustache/mustache/test/fixtures/examples/partials/partials.mustache deleted file mode 100644 index 54cf1c52..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/partials/partials.mustache +++ /dev/null @@ -1,7 +0,0 @@ -
- {{> header }} - -
- {{ page.content }} -
-
\ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/partials/partials.txt b/vendor/mustache/mustache/test/fixtures/examples/partials/partials.txt deleted file mode 100644 index f8e45ce3..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/partials/partials.txt +++ /dev/null @@ -1,8 +0,0 @@ -
-

Page Title

-

Page Subtitle

- -
- Lorem ipsum dolor sit amet. -
-
\ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/partials/partials/header.mustache b/vendor/mustache/mustache/test/fixtures/examples/partials/partials/header.mustache deleted file mode 100644 index 88d567b2..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/partials/partials/header.mustache +++ /dev/null @@ -1,4 +0,0 @@ -{{# page }} -

{{ title }}

-

{{ subtitle }}

-{{/ page }} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/recursive_partials/RecursivePartials.php b/vendor/mustache/mustache/test/fixtures/examples/recursive_partials/RecursivePartials.php deleted file mode 100644 index 15b6973d..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/recursive_partials/RecursivePartials.php +++ /dev/null @@ -1,22 +0,0 @@ - 'Dan', - 'child' => array( - 'name' => 'Justin', - 'child' => false, - ), - ); -} diff --git a/vendor/mustache/mustache/test/fixtures/examples/recursive_partials/partials/child.mustache b/vendor/mustache/mustache/test/fixtures/examples/recursive_partials/partials/child.mustache deleted file mode 100644 index 12829415..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/recursive_partials/partials/child.mustache +++ /dev/null @@ -1 +0,0 @@ - > {{ name }}{{#child}}{{>child}}{{/child}} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/recursive_partials/recursive_partials.mustache b/vendor/mustache/mustache/test/fixtures/examples/recursive_partials/recursive_partials.mustache deleted file mode 100644 index 0bc5d03d..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/recursive_partials/recursive_partials.mustache +++ /dev/null @@ -1 +0,0 @@ -{{name}}{{#child}}{{>child}}{{/child}} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/recursive_partials/recursive_partials.txt b/vendor/mustache/mustache/test/fixtures/examples/recursive_partials/recursive_partials.txt deleted file mode 100644 index 681cdef6..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/recursive_partials/recursive_partials.txt +++ /dev/null @@ -1 +0,0 @@ -George > Dan > Justin \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/section_iterator_objects/SectionIteratorObjects.php b/vendor/mustache/mustache/test/fixtures/examples/section_iterator_objects/SectionIteratorObjects.php deleted file mode 100644 index 0dc793c2..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/section_iterator_objects/SectionIteratorObjects.php +++ /dev/null @@ -1,27 +0,0 @@ - 'And it worked the second time.'), - array('item' => 'As well as the third.'), - ); - - public function middle() - { - return new ArrayIterator($this->_data); - } - - public $final = 'Then, surprisingly, it worked the final time.'; -} diff --git a/vendor/mustache/mustache/test/fixtures/examples/section_iterator_objects/section_iterator_objects.mustache b/vendor/mustache/mustache/test/fixtures/examples/section_iterator_objects/section_iterator_objects.mustache deleted file mode 100644 index 44dfce48..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/section_iterator_objects/section_iterator_objects.mustache +++ /dev/null @@ -1,5 +0,0 @@ -* {{ start }} -{{# middle }} -* {{ item }} -{{/ middle }} -* {{ final }} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/section_iterator_objects/section_iterator_objects.txt b/vendor/mustache/mustache/test/fixtures/examples/section_iterator_objects/section_iterator_objects.txt deleted file mode 100644 index e6b2d7af..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/section_iterator_objects/section_iterator_objects.txt +++ /dev/null @@ -1,4 +0,0 @@ -* It worked the first time. -* And it worked the second time. -* As well as the third. -* Then, surprisingly, it worked the final time. \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/section_magic_objects/SectionMagicObjects.php b/vendor/mustache/mustache/test/fixtures/examples/section_magic_objects/SectionMagicObjects.php deleted file mode 100644 index 0fcb3b4b..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/section_magic_objects/SectionMagicObjects.php +++ /dev/null @@ -1,40 +0,0 @@ - 'And it worked the second time.', - 'bar' => 'As well as the third.', - ); - - public function __get($key) - { - return isset($this->_data[$key]) ? $this->_data[$key] : null; - } - - public function __isset($key) - { - return isset($this->_data[$key]); - } -} diff --git a/vendor/mustache/mustache/test/fixtures/examples/section_magic_objects/section_magic_objects.mustache b/vendor/mustache/mustache/test/fixtures/examples/section_magic_objects/section_magic_objects.mustache deleted file mode 100644 index 91196085..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/section_magic_objects/section_magic_objects.mustache +++ /dev/null @@ -1,6 +0,0 @@ -* {{ start }} -{{# middle }} -* {{ foo }} -* {{ bar }} -{{/ middle }} -* {{ final }} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/section_magic_objects/section_magic_objects.txt b/vendor/mustache/mustache/test/fixtures/examples/section_magic_objects/section_magic_objects.txt deleted file mode 100644 index e6b2d7af..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/section_magic_objects/section_magic_objects.txt +++ /dev/null @@ -1,4 +0,0 @@ -* It worked the first time. -* And it worked the second time. -* As well as the third. -* Then, surprisingly, it worked the final time. \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/section_objects/SectionObjects.php b/vendor/mustache/mustache/test/fixtures/examples/section_objects/SectionObjects.php deleted file mode 100644 index 913c3ebd..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/section_objects/SectionObjects.php +++ /dev/null @@ -1,28 +0,0 @@ - 'And it worked the second time.'), - array('item' => 'As well as the third.'), - ); - } - - public $final = 'Then, surprisingly, it worked the final time.'; -} diff --git a/vendor/mustache/mustache/test/fixtures/examples/sections/sections.mustache b/vendor/mustache/mustache/test/fixtures/examples/sections/sections.mustache deleted file mode 100644 index 44dfce48..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/sections/sections.mustache +++ /dev/null @@ -1,5 +0,0 @@ -* {{ start }} -{{# middle }} -* {{ item }} -{{/ middle }} -* {{ final }} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/sections/sections.txt b/vendor/mustache/mustache/test/fixtures/examples/sections/sections.txt deleted file mode 100644 index e6b2d7af..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/sections/sections.txt +++ /dev/null @@ -1,4 +0,0 @@ -* It worked the first time. -* And it worked the second time. -* As well as the third. -* Then, surprisingly, it worked the final time. \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/sections_nested/SectionsNested.php b/vendor/mustache/mustache/test/fixtures/examples/sections_nested/SectionsNested.php deleted file mode 100644 index 43657c3d..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/sections_nested/SectionsNested.php +++ /dev/null @@ -1,44 +0,0 @@ - 'Von Kaiser', - 'enemies' => array( - array('name' => 'Super Macho Man'), - array('name' => 'Piston Honda'), - array('name' => 'Mr. Sandman'), - ), - ), - array( - 'name' => 'Mike Tyson', - 'enemies' => array( - array('name' => 'Soda Popinski'), - array('name' => 'King Hippo'), - array('name' => 'Great Tiger'), - array('name' => 'Glass Joe'), - ), - ), - array( - 'name' => 'Don Flamenco', - 'enemies' => array( - array('name' => 'Bald Bull'), - ), - ), - ); - } -} diff --git a/vendor/mustache/mustache/test/fixtures/examples/sections_nested/sections_nested.mustache b/vendor/mustache/mustache/test/fixtures/examples/sections_nested/sections_nested.mustache deleted file mode 100644 index 9f8007db..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/sections_nested/sections_nested.mustache +++ /dev/null @@ -1,7 +0,0 @@ -Enemies of {{ name }}: -{{# enemies }} -{{ name }} ... who also has enemies: -{{# enemies }} ---> {{ name }} -{{/ enemies }} -{{/ enemies }} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/sections_nested/sections_nested.txt b/vendor/mustache/mustache/test/fixtures/examples/sections_nested/sections_nested.txt deleted file mode 100644 index 72c44d06..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/sections_nested/sections_nested.txt +++ /dev/null @@ -1,12 +0,0 @@ -Enemies of Little Mac: -Von Kaiser ... who also has enemies: ---> Super Macho Man ---> Piston Honda ---> Mr. Sandman -Mike Tyson ... who also has enemies: ---> Soda Popinski ---> King Hippo ---> Great Tiger ---> Glass Joe -Don Flamenco ... who also has enemies: ---> Bald Bull diff --git a/vendor/mustache/mustache/test/fixtures/examples/simple/Simple.php b/vendor/mustache/mustache/test/fixtures/examples/simple/Simple.php deleted file mode 100644 index a5492e8f..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/simple/Simple.php +++ /dev/null @@ -1,23 +0,0 @@ -value - ($this->value * 0.4); - } - - public $in_ca = true; -} diff --git a/vendor/mustache/mustache/test/fixtures/examples/simple/simple.mustache b/vendor/mustache/mustache/test/fixtures/examples/simple/simple.mustache deleted file mode 100644 index 03df2068..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/simple/simple.mustache +++ /dev/null @@ -1,5 +0,0 @@ -Hello {{name}} -You have just won ${{value}}! -{{#in_ca}} -Well, ${{ taxed_value }}, after taxes. -{{/in_ca}} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/simple/simple.txt b/vendor/mustache/mustache/test/fixtures/examples/simple/simple.txt deleted file mode 100644 index 5d75d656..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/simple/simple.txt +++ /dev/null @@ -1,3 +0,0 @@ -Hello Chris -You have just won $10000! -Well, $6000, after taxes. diff --git a/vendor/mustache/mustache/test/fixtures/examples/unescaped/Unescaped.php b/vendor/mustache/mustache/test/fixtures/examples/unescaped/Unescaped.php deleted file mode 100644 index ea85f885..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/unescaped/Unescaped.php +++ /dev/null @@ -1,15 +0,0 @@ - Shark'; -} diff --git a/vendor/mustache/mustache/test/fixtures/examples/unescaped/unescaped.mustache b/vendor/mustache/mustache/test/fixtures/examples/unescaped/unescaped.mustache deleted file mode 100644 index 9982708a..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/unescaped/unescaped.mustache +++ /dev/null @@ -1 +0,0 @@ -

{{{title}}}

\ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/unescaped/unescaped.txt b/vendor/mustache/mustache/test/fixtures/examples/unescaped/unescaped.txt deleted file mode 100644 index 01fa4048..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/unescaped/unescaped.txt +++ /dev/null @@ -1 +0,0 @@ -

Bear > Shark

\ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/utf8/UTF8.php b/vendor/mustache/mustache/test/fixtures/examples/utf8/UTF8.php deleted file mode 100644 index c53fec9f..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/utf8/UTF8.php +++ /dev/null @@ -1,15 +0,0 @@ -中文 {{test}} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/utf8/utf8.txt b/vendor/mustache/mustache/test/fixtures/examples/utf8/utf8.txt deleted file mode 100644 index bf17971b..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/utf8/utf8.txt +++ /dev/null @@ -1 +0,0 @@ -

中文 中文又来啦

\ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/utf8_unescaped/UTF8Unescaped.php b/vendor/mustache/mustache/test/fixtures/examples/utf8_unescaped/UTF8Unescaped.php deleted file mode 100644 index 67f93666..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/utf8_unescaped/UTF8Unescaped.php +++ /dev/null @@ -1,15 +0,0 @@ -中文 {{{test}}} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/utf8_unescaped/utf8_unescaped.txt b/vendor/mustache/mustache/test/fixtures/examples/utf8_unescaped/utf8_unescaped.txt deleted file mode 100644 index bf17971b..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/utf8_unescaped/utf8_unescaped.txt +++ /dev/null @@ -1 +0,0 @@ -

中文 中文又来啦

\ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/whitespace/Whitespace.php b/vendor/mustache/mustache/test/fixtures/examples/whitespace/Whitespace.php deleted file mode 100644 index 57a3267f..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/whitespace/Whitespace.php +++ /dev/null @@ -1,43 +0,0 @@ - tag }}` and `{{> tag}}` and `{{>tag}}` should all be equivalent. - */ -class Whitespace -{ - public $foo = 'alpha'; - - public $bar = 'beta'; - - public function baz() - { - return 'gamma'; - } - - public function qux() - { - return array( - array('key with space' => 'A'), - array('key with space' => 'B'), - array('key with space' => 'C'), - array('key with space' => 'D'), - array('key with space' => 'E'), - array('key with space' => 'F'), - array('key with space' => 'G'), - ); - } -} diff --git a/vendor/mustache/mustache/test/fixtures/examples/whitespace/partials/alphabet.mustache b/vendor/mustache/mustache/test/fixtures/examples/whitespace/partials/alphabet.mustache deleted file mode 100644 index d281c41b..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/whitespace/partials/alphabet.mustache +++ /dev/null @@ -1 +0,0 @@ - * {{.}} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/whitespace/whitespace.mustache b/vendor/mustache/mustache/test/fixtures/examples/whitespace/whitespace.mustache deleted file mode 100644 index 0b3ba000..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/whitespace/whitespace.mustache +++ /dev/null @@ -1,10 +0,0 @@ -{{^ inverted section test }} -These are some things: -{{/inverted section test }} -* {{ foo }} -* {{ bar}} -* {{ baz }} -{{# qux }} -* {{ key with space }} -{{/ qux }} -{{#qux}}.{{/qux}} \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/examples/whitespace/whitespace.txt b/vendor/mustache/mustache/test/fixtures/examples/whitespace/whitespace.txt deleted file mode 100644 index 5226c698..00000000 --- a/vendor/mustache/mustache/test/fixtures/examples/whitespace/whitespace.txt +++ /dev/null @@ -1,12 +0,0 @@ -These are some things: -* alpha -* beta -* gamma -* A -* B -* C -* D -* E -* F -* G -....... \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/templates/alpha.ms b/vendor/mustache/mustache/test/fixtures/templates/alpha.ms deleted file mode 100644 index 3845830e..00000000 --- a/vendor/mustache/mustache/test/fixtures/templates/alpha.ms +++ /dev/null @@ -1 +0,0 @@ -alpha contents \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/templates/beta.ms b/vendor/mustache/mustache/test/fixtures/templates/beta.ms deleted file mode 100644 index a083dfe8..00000000 --- a/vendor/mustache/mustache/test/fixtures/templates/beta.ms +++ /dev/null @@ -1 +0,0 @@ -beta contents \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/templates/one.mustache b/vendor/mustache/mustache/test/fixtures/templates/one.mustache deleted file mode 100644 index f83ad095..00000000 --- a/vendor/mustache/mustache/test/fixtures/templates/one.mustache +++ /dev/null @@ -1 +0,0 @@ -one contents \ No newline at end of file diff --git a/vendor/mustache/mustache/test/fixtures/templates/two.mustache b/vendor/mustache/mustache/test/fixtures/templates/two.mustache deleted file mode 100644 index dacc40e2..00000000 --- a/vendor/mustache/mustache/test/fixtures/templates/two.mustache +++ /dev/null @@ -1 +0,0 @@ -two contents \ No newline at end of file diff --git a/vendor/scribu/lib-posts-to-posts/composer.json b/vendor/scribu/lib-posts-to-posts/composer.json index 233db869..1f32bb9f 100644 --- a/vendor/scribu/lib-posts-to-posts/composer.json +++ b/vendor/scribu/lib-posts-to-posts/composer.json @@ -9,5 +9,11 @@ }, "autoload": { "files": ["autoload.php"] - } + }, + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/jeffreyvr/wp-scb-framework/" + } + ] } From 6cc6c7981fa048a93f5c98b35eba5adbf59ad786 Mon Sep 17 00:00:00 2001 From: Jeffrey van Rossum Date: Mon, 28 Feb 2022 21:43:44 +0100 Subject: [PATCH 4/5] wip --- composer.json | 4 ++++ vendor/scribu/scb-framework/AdminPage.php | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 869e8e5d..74034999 100644 --- a/composer.json +++ b/composer.json @@ -13,6 +13,10 @@ { "type": "vcs", "url": "https://github.com/jeffreyvr/wp-lib-posts-to-posts" + }, + { + "type": "vcs", + "url": "https://github.com/jeffreyvr/wp-scb-framework" } ] } \ No newline at end of file diff --git a/vendor/scribu/scb-framework/AdminPage.php b/vendor/scribu/scb-framework/AdminPage.php index 7eb4c3b2..b73add5e 100644 --- a/vendor/scribu/scb-framework/AdminPage.php +++ b/vendor/scribu/scb-framework/AdminPage.php @@ -135,7 +135,9 @@ public function __construct( $file = false, $options = null ) { } add_action( 'admin_menu', array( $this, 'page_init' ), $this->args['admin_action_priority'] ); - add_filter( 'contextual_help', array( $this, '_contextual_help' ), 10, 2 ); + + // Commented out due to deprecated notice. + // add_filter( 'contextual_help', array( $this, '_contextual_help' ), 10, 2 ); if ( $file ) { $this->file = $file; From f21950328f5d44d69946fa592b39dd35b21a44d9 Mon Sep 17 00:00:00 2001 From: Jeffrey van Rossum Date: Mon, 28 Feb 2022 21:56:06 +0100 Subject: [PATCH 5/5] zip script --- composer.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/composer.json b/composer.json index 74034999..ca50a56f 100644 --- a/composer.json +++ b/composer.json @@ -4,6 +4,9 @@ "homepage": "http://wordpress.org/plugins/posts-to-posts", "license": "GPL-2.0+", "minimum-stability": "dev", + "scripts": { + "zip": "git archive --format zip --output \"../../posts-to-posts.zip\" master" + }, "require": { "composer/installers": "~1.0", "scribu/lib-posts-to-posts": "dev-master",