├── HttpPHPUnit ├── Config │ ├── Configuration.php │ ├── Configurator.php │ ├── Information.php │ └── Link.php ├── Events │ ├── Autowiring.php │ ├── AutowiringException.php │ ├── AutowiringFinder.php │ ├── Events.php │ └── ModuleEvents.php ├── Loaders │ ├── AutoLoader.php │ ├── IPHPUnitLoader.php │ └── IncludePathLoader.php ├── Modules │ ├── Coverage │ │ ├── Coverage.php │ │ └── LazyObject.php │ └── IModule.php ├── Nette │ └── nette.min.php ├── Rendering │ ├── NetteDebug.php │ ├── OpenInEditor.php │ ├── Renderer.php │ ├── ResultPrinter.php │ ├── ResultPrinterTestCaseHelper.php │ ├── StructureRenderer.latte │ ├── StructureRenderer.php │ ├── TemplateFactory.php │ └── layout.latte ├── Runner │ ├── Application.php │ ├── Command.php │ ├── Main.php │ └── Runner.php ├── assets │ ├── .htaccess │ ├── css │ │ └── screen.css │ ├── images │ │ ├── ajax-loader.gif │ │ ├── editor.png │ │ ├── favicon-failure.ico │ │ ├── favicon-ok.ico │ │ ├── favicon-unknown.ico │ │ ├── favicon-waiting.ico │ │ └── favicon.ico │ ├── js │ │ ├── init.js │ │ ├── listeners.js │ │ └── structure.js │ └── plugins │ │ ├── jQuery.TreeView │ │ ├── images │ │ │ ├── ajax-loader.gif │ │ │ ├── file.gif │ │ │ ├── folder-closed.gif │ │ │ ├── folder.gif │ │ │ ├── minus.gif │ │ │ ├── plus.gif │ │ │ ├── treeview-black-line.gif │ │ │ ├── treeview-black.gif │ │ │ ├── treeview-default-line.gif │ │ │ ├── treeview-default.gif │ │ │ ├── treeview-famfamfam-line.gif │ │ │ ├── treeview-famfamfam.gif │ │ │ ├── treeview-gray-line.gif │ │ │ ├── treeview-gray.gif │ │ │ ├── treeview-red-line.gif │ │ │ └── treeview-red.gif │ │ ├── jquery.treeview.css │ │ └── jquery.treeview.js │ │ └── jquery.min.js └── init.php ├── composer.json ├── libs ├── Nette │ ├── Application │ │ ├── Application.php │ │ ├── Diagnostics │ │ │ ├── RoutingPanel.php │ │ │ └── templates │ │ │ │ ├── RoutingPanel.panel.phtml │ │ │ │ └── RoutingPanel.tab.phtml │ │ ├── IPresenter.php │ │ ├── IPresenterFactory.php │ │ ├── IResponse.php │ │ ├── IRouter.php │ │ ├── MicroPresenter.php │ │ ├── PresenterFactory.php │ │ ├── Request.php │ │ ├── Responses │ │ │ ├── FileResponse.php │ │ │ ├── ForwardResponse.php │ │ │ ├── JsonResponse.php │ │ │ ├── RedirectResponse.php │ │ │ └── TextResponse.php │ │ ├── Routers │ │ │ ├── CliRouter.php │ │ │ ├── Route.php │ │ │ ├── RouteList.php │ │ │ └── SimpleRouter.php │ │ ├── UI │ │ │ ├── BadSignalException.php │ │ │ ├── Control.php │ │ │ ├── Form.php │ │ │ ├── IRenderable.php │ │ │ ├── ISignalReceiver.php │ │ │ ├── IStatePersistent.php │ │ │ ├── InvalidLinkException.php │ │ │ ├── Link.php │ │ │ ├── Multiplier.php │ │ │ ├── Presenter.php │ │ │ ├── PresenterComponent.php │ │ │ └── PresenterComponentReflection.php │ │ ├── exceptions.php │ │ └── templates │ │ │ └── error.phtml │ ├── Caching │ │ ├── Cache.php │ │ ├── IStorage.php │ │ ├── OutputHelper.php │ │ └── Storages │ │ │ ├── DevNullStorage.php │ │ │ ├── FileJournal.php │ │ │ ├── FileStorage.php │ │ │ ├── IJournal.php │ │ │ ├── MemcachedStorage.php │ │ │ ├── MemoryStorage.php │ │ │ └── PhpFileStorage.php │ ├── ComponentModel │ │ ├── Component.php │ │ ├── Container.php │ │ ├── IComponent.php │ │ ├── IContainer.php │ │ └── RecursiveComponentIterator.php │ ├── Config │ │ ├── Adapters │ │ │ ├── IniAdapter.php │ │ │ ├── NeonAdapter.php │ │ │ └── PhpAdapter.php │ │ ├── Compiler.php │ │ ├── CompilerExtension.php │ │ ├── Configurator.php │ │ ├── Extensions │ │ │ ├── ConstantsExtension.php │ │ │ ├── NetteExtension.php │ │ │ └── PhpExtension.php │ │ ├── Helpers.php │ │ ├── IAdapter.php │ │ └── Loader.php │ ├── DI │ │ ├── Container.php │ │ ├── ContainerBuilder.php │ │ ├── Diagnostics │ │ │ ├── ContainerPanel.php │ │ │ └── templates │ │ │ │ ├── ContainerPanel.panel.phtml │ │ │ │ └── ContainerPanel.tab.phtml │ │ ├── Helpers.php │ │ ├── IContainer.php │ │ ├── NestedAccessor.php │ │ ├── ServiceDefinition.php │ │ ├── Statement.php │ │ └── exceptions.php │ ├── Database │ │ ├── Connection.php │ │ ├── Diagnostics │ │ │ └── ConnectionPanel.php │ │ ├── Drivers │ │ │ ├── MsSqlDriver.php │ │ │ ├── MySqlDriver.php │ │ │ ├── OciDriver.php │ │ │ ├── OdbcDriver.php │ │ │ ├── PgSqlDriver.php │ │ │ ├── Sqlite2Driver.php │ │ │ └── SqliteDriver.php │ │ ├── Helpers.php │ │ ├── IReflection.php │ │ ├── ISupplementalDriver.php │ │ ├── Reflection │ │ │ ├── ConventionalReflection.php │ │ │ └── DiscoveredReflection.php │ │ ├── Row.php │ │ ├── SqlLiteral.php │ │ ├── SqlPreprocessor.php │ │ ├── Statement.php │ │ └── Table │ │ │ ├── ActiveRow.php │ │ │ ├── GroupedSelection.php │ │ │ ├── Selection.php │ │ │ └── SqlBuilder.php │ ├── Diagnostics │ │ ├── Bar.php │ │ ├── BlueScreen.php │ │ ├── Debugger.php │ │ ├── DefaultBarPanel.php │ │ ├── FireLogger.php │ │ ├── Helpers.php │ │ ├── IBarPanel.php │ │ ├── Logger.php │ │ ├── shortcuts.php │ │ └── templates │ │ │ ├── bar.dumps.panel.phtml │ │ │ ├── bar.dumps.tab.phtml │ │ │ ├── bar.errors.panel.phtml │ │ │ ├── bar.errors.tab.phtml │ │ │ ├── bar.memory.tab.phtml │ │ │ ├── bar.phtml │ │ │ ├── bar.time.tab.phtml │ │ │ ├── bluescreen.phtml │ │ │ ├── error.phtml │ │ │ └── netteQ.js │ ├── Forms │ │ ├── Container.php │ │ ├── ControlGroup.php │ │ ├── Controls │ │ │ ├── BaseControl.php │ │ │ ├── Button.php │ │ │ ├── Checkbox.php │ │ │ ├── HiddenField.php │ │ │ ├── ImageButton.php │ │ │ ├── MultiSelectBox.php │ │ │ ├── RadioList.php │ │ │ ├── SelectBox.php │ │ │ ├── SubmitButton.php │ │ │ ├── TextArea.php │ │ │ ├── TextBase.php │ │ │ ├── TextInput.php │ │ │ └── UploadControl.php │ │ ├── Form.php │ │ ├── IControl.php │ │ ├── IFormRenderer.php │ │ ├── ISubmitterControl.php │ │ ├── Rendering │ │ │ └── DefaultFormRenderer.php │ │ ├── Rule.php │ │ └── Rules.php │ ├── Http │ │ ├── Context.php │ │ ├── FileUpload.php │ │ ├── IRequest.php │ │ ├── IResponse.php │ │ ├── ISessionStorage.php │ │ ├── Request.php │ │ ├── RequestFactory.php │ │ ├── Response.php │ │ ├── Session.php │ │ ├── SessionSection.php │ │ ├── Url.php │ │ ├── UrlScript.php │ │ └── UserStorage.php │ ├── Iterators │ │ ├── CachingIterator.php │ │ ├── Filter.php │ │ ├── InstanceFilter.php │ │ ├── Mapper.php │ │ ├── RecursiveFilter.php │ │ └── Recursor.php │ ├── Latte │ │ ├── Compiler.php │ │ ├── Engine.php │ │ ├── HtmlNode.php │ │ ├── IMacro.php │ │ ├── MacroNode.php │ │ ├── MacroTokenizer.php │ │ ├── Macros │ │ │ ├── CacheMacro.php │ │ │ ├── CoreMacros.php │ │ │ ├── FormMacros.php │ │ │ ├── MacroSet.php │ │ │ └── UIMacros.php │ │ ├── Parser.php │ │ ├── PhpWriter.php │ │ ├── Token.php │ │ └── exceptions.php │ ├── Loaders │ │ ├── AutoLoader.php │ │ ├── NetteLoader.php │ │ └── RobotLoader.php │ ├── Localization │ │ └── ITranslator.php │ ├── Mail │ │ ├── IMailer.php │ │ ├── Message.php │ │ ├── MimePart.php │ │ ├── SendmailMailer.php │ │ └── SmtpMailer.php │ ├── Reflection │ │ ├── Annotation.php │ │ ├── AnnotationsParser.php │ │ ├── ClassType.php │ │ ├── Extension.php │ │ ├── GlobalFunction.php │ │ ├── IAnnotation.php │ │ ├── Method.php │ │ ├── Parameter.php │ │ └── Property.php │ ├── Security │ │ ├── AuthenticationException.php │ │ ├── Diagnostics │ │ │ ├── UserPanel.php │ │ │ └── templates │ │ │ │ ├── UserPanel.panel.phtml │ │ │ │ └── UserPanel.tab.phtml │ │ ├── IAuthenticator.php │ │ ├── IAuthorizator.php │ │ ├── IIdentity.php │ │ ├── IResource.php │ │ ├── IRole.php │ │ ├── IUserStorage.php │ │ ├── Identity.php │ │ ├── Permission.php │ │ ├── SimpleAuthenticator.php │ │ └── User.php │ ├── Templating │ │ ├── FileTemplate.php │ │ ├── FilterException.php │ │ ├── Helpers.php │ │ ├── IFileTemplate.php │ │ ├── ITemplate.php │ │ └── Template.php │ ├── Utils │ │ ├── Arrays.php │ │ ├── Finder.php │ │ ├── Html.php │ │ ├── Json.php │ │ ├── LimitedScope.php │ │ ├── MimeTypeDetector.php │ │ ├── Neon.php │ │ ├── Paginator.php │ │ ├── PhpGenerator │ │ │ ├── ClassType.php │ │ │ ├── Helpers.php │ │ │ ├── Method.php │ │ │ ├── Parameter.php │ │ │ ├── PhpLiteral.php │ │ │ └── Property.php │ │ ├── SafeStream.php │ │ ├── Strings.php │ │ ├── Tokenizer.php │ │ └── Validators.php │ ├── common │ │ ├── ArrayHash.php │ │ ├── ArrayList.php │ │ ├── Callback.php │ │ ├── DateTime.php │ │ ├── Environment.php │ │ ├── Framework.php │ │ ├── FreezableObject.php │ │ ├── IFreezable.php │ │ ├── Image.php │ │ ├── Object.php │ │ ├── ObjectMixin.php │ │ └── exceptions.php │ └── loader.php ├── PHPUnit │ ├── File │ │ ├── Iterator.php │ │ └── Iterator │ │ │ └── Factory.php │ ├── PHP │ │ ├── CodeCoverage.php │ │ ├── CodeCoverage │ │ │ ├── Driver.php │ │ │ ├── Driver │ │ │ │ └── Xdebug.php │ │ │ ├── Filter.php │ │ │ ├── Report │ │ │ │ ├── Clover.php │ │ │ │ ├── HTML.php │ │ │ │ └── HTML │ │ │ │ │ ├── Node.php │ │ │ │ │ ├── Node │ │ │ │ │ ├── Directory.php │ │ │ │ │ ├── File.php │ │ │ │ │ └── Iterator.php │ │ │ │ │ └── Template │ │ │ │ │ ├── RGraph.bar.js │ │ │ │ │ ├── RGraph.common.core.js │ │ │ │ │ ├── RGraph.common.tooltips.js │ │ │ │ │ ├── RGraph.scatter.js │ │ │ │ │ ├── butter.png │ │ │ │ │ ├── chameleon.png │ │ │ │ │ ├── close12_1.gif │ │ │ │ │ ├── container-min.js │ │ │ │ │ ├── container.css │ │ │ │ │ ├── dashboard.html.dist │ │ │ │ │ ├── directory.html.dist │ │ │ │ │ ├── directory.png │ │ │ │ │ ├── directory_item.html.dist │ │ │ │ │ ├── excanvas.compressed.js │ │ │ │ │ ├── file.html.dist │ │ │ │ │ ├── file.png │ │ │ │ │ ├── file_item.html.dist │ │ │ │ │ ├── file_no_yui.html.dist │ │ │ │ │ ├── glass.png │ │ │ │ │ ├── method_item.html.dist │ │ │ │ │ ├── scarlet_red.png │ │ │ │ │ ├── snow.png │ │ │ │ │ ├── style.css │ │ │ │ │ ├── yahoo-dom-event.js │ │ │ │ │ └── yui_item.js │ │ │ ├── TextUI │ │ │ │ └── Command.php │ │ │ └── Util.php │ │ ├── Timer.php │ │ ├── Token.php │ │ └── Token │ │ │ ├── Exception.php │ │ │ ├── Stream.php │ │ │ └── Stream │ │ │ ├── CachingFactory.php │ │ │ └── TextUI │ │ │ └── Command.php │ ├── PHPUnit │ │ ├── Autoload.php │ │ ├── Extensions │ │ │ ├── GroupTestSuite.php │ │ │ ├── OutputTestCase.php │ │ │ ├── PhptTestCase.php │ │ │ ├── PhptTestCase │ │ │ │ └── Logger.php │ │ │ ├── PhptTestSuite.php │ │ │ ├── RepeatedTest.php │ │ │ ├── Story │ │ │ │ ├── Given.php │ │ │ │ ├── ResultPrinter.php │ │ │ │ ├── ResultPrinter │ │ │ │ │ ├── HTML.php │ │ │ │ │ ├── Template │ │ │ │ │ │ ├── scenario.html.dist │ │ │ │ │ │ ├── scenario_header.html.dist │ │ │ │ │ │ ├── scenarios.html.dist │ │ │ │ │ │ └── step.html.dist │ │ │ │ │ └── Text.php │ │ │ │ ├── Scenario.php │ │ │ │ ├── Step.php │ │ │ │ ├── TestCase.php │ │ │ │ ├── Then.php │ │ │ │ └── When.php │ │ │ ├── TestDecorator.php │ │ │ ├── TicketListener.php │ │ │ └── TicketListener │ │ │ │ ├── GitHub.php │ │ │ │ ├── GoogleCode.php │ │ │ │ └── Trac.php │ │ ├── Framework.php │ │ ├── Framework │ │ │ ├── Assert.php │ │ │ ├── Assert │ │ │ │ ├── Functions.php │ │ │ │ └── Functions.php.in │ │ │ ├── AssertionFailedError.php │ │ │ ├── ComparisonFailure.php │ │ │ ├── ComparisonFailure │ │ │ │ ├── Array.php │ │ │ │ ├── Object.php │ │ │ │ ├── Scalar.php │ │ │ │ ├── String.php │ │ │ │ └── Type.php │ │ │ ├── Constraint.php │ │ │ ├── Constraint │ │ │ │ ├── And.php │ │ │ │ ├── ArrayHasKey.php │ │ │ │ ├── Attribute.php │ │ │ │ ├── ClassHasAttribute.php │ │ │ │ ├── ClassHasStaticAttribute.php │ │ │ │ ├── FileExists.php │ │ │ │ ├── GreaterThan.php │ │ │ │ ├── IsAnything.php │ │ │ │ ├── IsEmpty.php │ │ │ │ ├── IsEqual.php │ │ │ │ ├── IsFalse.php │ │ │ │ ├── IsIdentical.php │ │ │ │ ├── IsInstanceOf.php │ │ │ │ ├── IsNull.php │ │ │ │ ├── IsTrue.php │ │ │ │ ├── IsType.php │ │ │ │ ├── LessThan.php │ │ │ │ ├── Not.php │ │ │ │ ├── ObjectHasAttribute.php │ │ │ │ ├── Or.php │ │ │ │ ├── PCREMatch.php │ │ │ │ ├── StringContains.php │ │ │ │ ├── StringEndsWith.php │ │ │ │ ├── StringMatches.php │ │ │ │ ├── StringStartsWith.php │ │ │ │ ├── TraversableContains.php │ │ │ │ ├── TraversableContainsOnly.php │ │ │ │ └── Xor.php │ │ │ ├── Error.php │ │ │ ├── Error │ │ │ │ ├── Notice.php │ │ │ │ └── Warning.php │ │ │ ├── Exception.php │ │ │ ├── ExpectationFailedException.php │ │ │ ├── IncompleteTest.php │ │ │ ├── IncompleteTestError.php │ │ │ ├── Process │ │ │ │ └── TestCaseMethod.tpl.dist │ │ │ ├── SelfDescribing.php │ │ │ ├── SkippedTest.php │ │ │ ├── SkippedTestError.php │ │ │ ├── SkippedTestSuiteError.php │ │ │ ├── SyntheticError.php │ │ │ ├── Test.php │ │ │ ├── TestCase.php │ │ │ ├── TestFailure.php │ │ │ ├── TestListener.php │ │ │ ├── TestResult.php │ │ │ ├── TestSuite.php │ │ │ ├── TestSuite │ │ │ │ └── DataProvider.php │ │ │ └── Warning.php │ │ ├── Runner │ │ │ ├── BaseTestRunner.php │ │ │ ├── IncludePathTestCollector.php │ │ │ ├── StandardTestSuiteLoader.php │ │ │ ├── TestCollector.php │ │ │ ├── TestSuiteLoader.php │ │ │ └── Version.php │ │ ├── TextUI │ │ │ ├── Command.php │ │ │ ├── ResultPrinter.php │ │ │ └── TestRunner.php │ │ └── Util │ │ │ ├── Class.php │ │ │ ├── Configuration.php │ │ │ ├── DeprecatedFeature.php │ │ │ ├── DeprecatedFeature │ │ │ └── Logger.php │ │ │ ├── Diff.php │ │ │ ├── ErrorHandler.php │ │ │ ├── File.php │ │ │ ├── Fileloader.php │ │ │ ├── Filesystem.php │ │ │ ├── Filter.php │ │ │ ├── Getopt.php │ │ │ ├── GlobalState.php │ │ │ ├── InvalidArgumentHelper.php │ │ │ ├── Log │ │ │ ├── DBUS.php │ │ │ ├── JSON.php │ │ │ ├── JUnit.php │ │ │ ├── TAP.php │ │ │ └── XHProf.php │ │ │ ├── PHP.php │ │ │ ├── PHP │ │ │ ├── Default.php │ │ │ └── Windows.php │ │ │ ├── Printer.php │ │ │ ├── Skeleton.php │ │ │ ├── Skeleton │ │ │ ├── Class.php │ │ │ ├── Template │ │ │ │ ├── Class.tpl.dist │ │ │ │ ├── IncompleteTestMethod.tpl.dist │ │ │ │ ├── Method.tpl.dist │ │ │ │ ├── TestClass.tpl.dist │ │ │ │ ├── TestMethod.tpl.dist │ │ │ │ ├── TestMethodBool.tpl.dist │ │ │ │ ├── TestMethodBoolStatic.tpl.dist │ │ │ │ ├── TestMethodException.tpl.dist │ │ │ │ ├── TestMethodExceptionStatic.tpl.dist │ │ │ │ └── TestMethodStatic.tpl.dist │ │ │ └── Test.php │ │ │ ├── Test.php │ │ │ ├── TestDox │ │ │ ├── NamePrettifier.php │ │ │ ├── ResultPrinter.php │ │ │ └── ResultPrinter │ │ │ │ ├── HTML.php │ │ │ │ └── Text.php │ │ │ ├── TestSuiteIterator.php │ │ │ ├── Type.php │ │ │ └── XML.php │ └── Text │ │ ├── Template.php │ │ └── Template │ │ └── Autoload.php └── dump.php └── tests ├── TestCase.php ├── boot.php ├── cases ├── Config │ ├── Config_Configuration_Test.php │ ├── Config_Configuration_addArgument_Test.php │ ├── Config_Information_Test.php │ └── Config_Link_Test.php ├── Events │ ├── Events_Autowiring_Test.php │ └── Events_Events_Test.php ├── Loaders │ ├── Loaders_AutoLoader_Test.php │ └── Loaders_IncludePathLoader_Test.php ├── Main │ ├── Main_arg_Test.php │ └── Main_coverage_Test.php └── Rendering │ ├── NetteDebug_call_Test.php │ ├── NetteDebug_construct_Test.php │ ├── NetteDebug_get_Test.php │ ├── NetteDebug_isset_Test.php │ ├── NetteDebug_set_Test.php │ ├── NetteDebug_singleton_Test.php │ ├── Rendering_StructureRenderer_Test.php │ ├── ResultPrinter_endRun_Test.php │ ├── ResultPrinter_getTestInfo_Test.php │ └── ResultPrinter_renderInfo_Test.php ├── report └── .gitignore ├── run.php └── tmp └── .gitignore /HttpPHPUnit/Config/Information.php: -------------------------------------------------------------------------------- 1 | configuration = $configuration; 23 | } 24 | 25 | /** @return bool */ 26 | public function isRunnedAllTest() 27 | { 28 | if ($this->configuration->isRunned() AND !$this->configuration->getFilterDirectory()) 29 | { 30 | return true; 31 | } 32 | return false; 33 | } 34 | 35 | /** @return bool */ 36 | public function isFiltered() 37 | { 38 | if ($this->configuration->getFilterDirectory() OR $this->configuration->getFilterMethod()) 39 | { 40 | return true; 41 | } 42 | return false; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /HttpPHPUnit/Events/AutowiringException.php: -------------------------------------------------------------------------------- 1 | 18 | * $r instanceof ReflectionFunctionAbstract 19 | * throw AutowiringException::create('message', $r->getFileName(), $r->getStartLine()); 20 | * 21 | * @param string 22 | * @param string 23 | * @param int 24 | * @param int 25 | * @return AutowiringException 26 | */ 27 | public static function create($message, $file, $line, $code = NULL) 28 | { 29 | $e = new static($message, $code); 30 | $e->file = $file; 31 | $e->line = $line; 32 | return $e; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /HttpPHPUnit/Events/AutowiringFinder.php: -------------------------------------------------------------------------------- 1 | string lowercased class names. */ 18 | private $allowedClasses; 19 | 20 | /** 21 | * @param Autowiring 22 | * @param array|NULL Restricted classes which can be autowired. {@see Autowiring::convertAllowedClassesArray()} 23 | * Null mean no restriction. 24 | * Array must be converted via {@see Autowiring::convertAllowedClassesArray()}. 25 | */ 26 | public function __construct(Autowiring $autowiring, array $allowedClasses = NULL) 27 | { 28 | $this->autowiring = $autowiring; 29 | $this->allowedClasses = $allowedClasses; 30 | } 31 | 32 | /** 33 | * Find object by class or interface. 34 | * @param strng class or interface name 35 | * @param bool false = throw exception if not found; true = return null id not found. 36 | * @return object|NULL 37 | * @throws AutowiringException 38 | */ 39 | public function getByClass($class, $need = true) 40 | { 41 | static $finderClass; 42 | if ($finderClass === NULL) 43 | { 44 | $finderClass = strtolower(__CLASS__); 45 | } 46 | $lcClass = strtolower($class); 47 | if ($lcClass === $finderClass) 48 | { 49 | return $this; 50 | } 51 | if ($this->allowedClasses !== NULL AND !isset($this->allowedClasses[$lcClass])) 52 | { 53 | if ($need) 54 | { 55 | throw new AutowiringException("Autowired class {$class} is not allowed."); 56 | } 57 | return NULL; 58 | } 59 | return $this->autowiring->getByClass($class, $need); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /HttpPHPUnit/Events/ModuleEvents.php: -------------------------------------------------------------------------------- 1 | events = $events; 44 | $this->moduleName = $moduleName; 45 | } 46 | 47 | /** 48 | * @param string 49 | * @param array 50 | * @return ModuleEvents $this 51 | */ 52 | public function __call($name, $arguments) 53 | { 54 | $this->events->registerListener($name, $this->moduleName, $arguments[0], isset($arguments[1]) ? $arguments[1] : NULL); 55 | return $this; 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /HttpPHPUnit/Loaders/AutoLoader.php: -------------------------------------------------------------------------------- 1 | 12 | * require_once __DIR__ . '/Loaders/AutoLoader.php'; 13 | * AutoLoader::getInstance()->register(); 14 | * 15 | * 16 | * @author Petr Prochazka 17 | * Based on Nette Framework (c) David Grudl (http://davidgrudl.com) 18 | */ 19 | class AutoLoader/* extends Object*/ 20 | { 21 | 22 | /** @var AutoLoader */ 23 | private static $instance; 24 | 25 | /** @var array expectedPath => actualPath non PSR-0 */ 26 | protected $list = array( 27 | 'Main' => 'Runner/Main', 28 | 'Nette' => 'Nette/nette.min', 29 | ); 30 | 31 | /** 32 | * Returns singleton instance with lazy instantiation. 33 | * @return AutoLoader 34 | */ 35 | public static function getInstance() 36 | { 37 | if (self::$instance === NULL) 38 | { 39 | self::$instance = new static; 40 | } 41 | return self::$instance; 42 | } 43 | 44 | /** 45 | * Register autoloader. 46 | * @return void 47 | */ 48 | public function register() 49 | { 50 | if (!function_exists('spl_autoload_register')) 51 | { 52 | throw new Exception('spl_autoload does not exist in this PHP installation.'); 53 | } 54 | 55 | spl_autoload_register(array($this, 'tryLoad')); 56 | } 57 | 58 | /** 59 | * Unregister autoloader. 60 | * @return bool 61 | */ 62 | public function unregister() 63 | { 64 | return spl_autoload_unregister(array($this, 'tryLoad')); 65 | } 66 | 67 | /** 68 | * Handles autoloading of classes or interfaces. 69 | * @param string 70 | * @return void 71 | */ 72 | public function tryLoad($type) 73 | { 74 | $dir = __DIR__ . '/..'; 75 | $type = ltrim($type, '\\'); 76 | if (substr($type, 0, 12) === 'HttpPHPUnit\\') 77 | { 78 | $file = strtr(substr($type, 12), '\\', '/'); 79 | if (substr($file, 0, 6) === 'Nette/') 80 | { 81 | $file = $this->list['Nette']; 82 | } 83 | else if (isset($this->list[$file])) 84 | { 85 | $file = $this->list[$file]; 86 | } 87 | $include = $dir . '/' . $file . '.php'; 88 | if (is_file($include)) 89 | { 90 | require_once $include; 91 | } 92 | } 93 | 94 | } 95 | 96 | } 97 | -------------------------------------------------------------------------------- /HttpPHPUnit/Loaders/IPHPUnitLoader.php: -------------------------------------------------------------------------------- 1 | class = $class; 46 | return; 47 | } 48 | } 49 | throw new Exception; 50 | } 51 | 52 | /** 53 | * @param string 54 | * @param array 55 | * @return mixed 56 | */ 57 | public function __call($name, $args) 58 | { 59 | return call_user_func_array(array($this->class, $name), $args); 60 | } 61 | 62 | /** 63 | * @param string 64 | * @return mixed 65 | */ 66 | public function & __get($name) 67 | { 68 | $r = new ReflectionProperty($this->class, $name); 69 | $tmp = $r->getValue(); 70 | return $tmp; 71 | } 72 | 73 | /** 74 | * @param string 75 | * @param mixed 76 | * @return mixed 77 | */ 78 | public function __set($name, $value) 79 | { 80 | $r = new ReflectionProperty($this->class, $name); 81 | $r->setValue($value); 82 | return; 83 | } 84 | 85 | /** 86 | * @param string 87 | * @return bool 88 | */ 89 | public function __isset($name) 90 | { 91 | if (!property_exists($this->class, $name)) 92 | { 93 | return false; 94 | } 95 | return $this->__get($name) !== NULL; 96 | } 97 | 98 | } 99 | -------------------------------------------------------------------------------- /HttpPHPUnit/Rendering/OpenInEditor.php: -------------------------------------------------------------------------------- 1 | editor)) 19 | { 20 | self::$editor = NetteDebug::get()->editor; 21 | } 22 | } 23 | 24 | /** 25 | * @param string 26 | * @param int 27 | * @return string|NULL 28 | */ 29 | public function link($file, $line) 30 | { 31 | if (self::$editor AND is_file($file)) 32 | { 33 | return strtr(self::$editor, array('%file' => rawurlencode($file), '%line' => (int) $line)); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /HttpPHPUnit/Rendering/ResultPrinterTestCaseHelper.php: -------------------------------------------------------------------------------- 1 | getDataSetAsString(); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /HttpPHPUnit/Rendering/StructureRenderer.latte: -------------------------------------------------------------------------------- 1 | {** 2 | * @author Petr Prochazka 3 | * @author Jan Tvrdík 4 | * @param string $backToAllLink 5 | * @param string $basePath 6 | * @param array $structure 7 | *} 8 | 9 |
10 | 11 |

« Back to all

12 | 13 | 14 | 30 | 31 |
32 |

33 | Use shift + click to open a file in editor.
34 | Use double click to run a specific folder or file. 35 |

36 |
37 | 38 |
39 | 40 | {* Assets 2 (úmyslně za definicí #structure) *} 41 | 42 | -------------------------------------------------------------------------------- /HttpPHPUnit/Rendering/TemplateFactory.php: -------------------------------------------------------------------------------- 1 | onPrepareFilters[] = function ($template) { 19 | $template->registerFilter(new Engine); 20 | }; 21 | $template->registerHelperLoader('HttpPHPUnit\Nette\Templating\Helpers::loader'); 22 | $template->setFile($file); 23 | $template->basePath = self::getBasePath(); 24 | return $template; 25 | } 26 | 27 | public static function getBasePath() 28 | { 29 | $dir = realpath(__DIR__ . '/..'); 30 | $documentRoot = realpath($_SERVER['DOCUMENT_ROOT']); 31 | if (!$documentRoot) throw new Exception; 32 | $documentRoot = rtrim($documentRoot, DIRECTORY_SEPARATOR); 33 | $tmp = $documentRoot . DIRECTORY_SEPARATOR; 34 | if ($documentRoot != $dir AND strncmp($dir, $tmp, strlen($tmp)) !== 0) throw new Exception; 35 | return str_replace('\\', '/', substr($dir, strlen($documentRoot))); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /HttpPHPUnit/Rendering/layout.latte: -------------------------------------------------------------------------------- 1 | {** 2 | * @author Petr Prochazka 3 | * @param HttpPHPUnit\Rendering\Renderer $renderer 4 | * @param string|NULL $filterDirectory 5 | * @param string|NULL $filterMethod 6 | * @param string $basePath 7 | *} 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | Tests | in progress 19 |
20 | {$renderer->printPhpUnitVersion()} 21 |

22 | {if $filterDirectory} 23 | {$filterDirectory}{if $filterMethod} :: {$filterMethod}{/if} 24 | {else} 25 | All tests 26 | {/if} 27 |

28 |

29 | 30 | in progress 31 | 32 | 36 | 37 |
38 |

39 |
40 |
41 | 42 | {=$renderer->renderStructure()} 43 | 44 |
45 | 46 | {=$renderer->renderRunner()} 47 | {=$renderer->renderWaiting()} 48 | 49 |
50 |
51 | -------------------------------------------------------------------------------- /HttpPHPUnit/Runner/Application.php: -------------------------------------------------------------------------------- 1 | runner = $runner; 32 | $this->renderer = $renderer; 33 | $this->configuration = $configuration; 34 | $this->events = $events; 35 | } 36 | 37 | /** Run HttpPHPUnit */ 38 | public function run() 39 | { 40 | $this->events->triggerListener('onStart'); 41 | $this->renderer->render(); 42 | $this->events->triggerListener('onEnd'); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /HttpPHPUnit/Runner/Command.php: -------------------------------------------------------------------------------- 1 | arguments['printer'] = $printer; 25 | parent::run($argv, false); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /HttpPHPUnit/Runner/Runner.php: -------------------------------------------------------------------------------- 1 | configuration = $configuration; 28 | $this->events = $events; 29 | } 30 | 31 | /** 32 | * @param Rendering\ResultPrinter 33 | * @see Command 34 | */ 35 | public function run(Rendering\ResultPrinter $printer) 36 | { 37 | $argumens = $this->configuration->getArguments(); 38 | $command = new Command; 39 | $command->run($argumens, $printer); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /HttpPHPUnit/assets/.htaccess: -------------------------------------------------------------------------------- 1 | Order Allow,Deny 2 | Allow from all 3 | -------------------------------------------------------------------------------- /HttpPHPUnit/assets/images/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Clevis/HttpPHPUnit/f81b85c5b6e2e44885534720f6189517f6e6d7e6/HttpPHPUnit/assets/images/ajax-loader.gif -------------------------------------------------------------------------------- /HttpPHPUnit/assets/images/editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Clevis/HttpPHPUnit/f81b85c5b6e2e44885534720f6189517f6e6d7e6/HttpPHPUnit/assets/images/editor.png -------------------------------------------------------------------------------- /HttpPHPUnit/assets/images/favicon-failure.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Clevis/HttpPHPUnit/f81b85c5b6e2e44885534720f6189517f6e6d7e6/HttpPHPUnit/assets/images/favicon-failure.ico -------------------------------------------------------------------------------- /HttpPHPUnit/assets/images/favicon-ok.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Clevis/HttpPHPUnit/f81b85c5b6e2e44885534720f6189517f6e6d7e6/HttpPHPUnit/assets/images/favicon-ok.ico -------------------------------------------------------------------------------- /HttpPHPUnit/assets/images/favicon-unknown.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Clevis/HttpPHPUnit/f81b85c5b6e2e44885534720f6189517f6e6d7e6/HttpPHPUnit/assets/images/favicon-unknown.ico -------------------------------------------------------------------------------- /HttpPHPUnit/assets/images/favicon-waiting.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Clevis/HttpPHPUnit/f81b85c5b6e2e44885534720f6189517f6e6d7e6/HttpPHPUnit/assets/images/favicon-waiting.ico -------------------------------------------------------------------------------- /HttpPHPUnit/assets/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Clevis/HttpPHPUnit/f81b85c5b6e2e44885534720f6189517f6e6d7e6/HttpPHPUnit/assets/images/favicon.ico -------------------------------------------------------------------------------- /HttpPHPUnit/assets/js/init.js: -------------------------------------------------------------------------------- 1 | $.extend($.fn.disableTextSelect = function () { 2 | return this.each(function () { 3 | if ($.browser.mozilla) { 4 | $(this).css('MozUserSelect', 'none'); 5 | } else if($.browser.msie) { 6 | $(this).bind('selectstart', function () { 7 | return false; 8 | }); 9 | } else{ 10 | $(this).mousedown(function () { 11 | return false; 12 | }); 13 | } 14 | }); 15 | }); 16 | 17 | var Progress = (function () { 18 | var number = 0, numberAll = 1; 19 | var infoCount, infoText, progressBar, title; 20 | 21 | var interval; 22 | if (window.chrome && window.chrome.csi) 23 | { 24 | interval = setInterval(function () { 25 | if (window.chrome.csi().onloadT !== 0) Progress.ready(); 26 | }, 1000); 27 | } 28 | $(function () { 29 | Progress.ready(); 30 | }); 31 | 32 | return { 33 | start: function (countAll) { 34 | numberAll = countAll; 35 | $('header h2 .info .countAll').text(countAll); 36 | $('header h2 .info').show(); 37 | infoCount = $('header h2 .info .count'); 38 | infoText = $('header h2 .info .text'); 39 | progressBar = $('header h2 .progressBar'); 40 | title = $('title'); 41 | }, 42 | add: function (text) { 43 | infoCount.text(number); 44 | infoText.text(text); 45 | progressBar.css('width', (number/numberAll)*100 + '%'); 46 | title.text('Tests | ' + number + '/' + numberAll + ' | ' + text); 47 | number++ 48 | }, 49 | end: function () { 50 | Progress.add(''); 51 | }, 52 | ready: function () { 53 | clearInterval(interval); 54 | var header = $('header'); 55 | var sentence = $('#sentence'); 56 | var state = sentence.data('state') || 'unknown'; 57 | var text = sentence.text() || 'ERROR'; 58 | header.addClass(state); 59 | header.find('h2').text(text); 60 | if (!title) title = $('title'); 61 | title.text('Tests | ' + state + ' | ' + text); 62 | 63 | // aktualizace favicon 64 | var favicon = $('head > link[rel=icon]'); 65 | favicon.attr('href', favicon.attr('href').replace(/(\.ico)$/, '-' + state + '$1')); 66 | favicon.remove().appendTo('head'); // kvůli FF 67 | } 68 | }; 69 | })(); 70 | -------------------------------------------------------------------------------- /HttpPHPUnit/assets/js/listeners.js: -------------------------------------------------------------------------------- 1 | 2 | $('.message-link').live('click', function () { 3 | var p = $(this).parents('div').eq(0) 4 | $('.message-short, .message-full', p).toggle(); 5 | $('span', this).toggle(); 6 | return false; 7 | }); 8 | 9 | $('#structure .node.file').live('click', function (e) { 10 | if (e.button == 0 && e.shiftKey) { 11 | var editor = $(this).find('.actions .editor'); 12 | location.href = editor.attr('href'); 13 | e.preventDefault(); 14 | } 15 | }); 16 | 17 | $('.failure h3 > a, .error h3 > a').live('click', function (e) { 18 | if (e.button == 0 && e.shiftKey) { 19 | var editor = $(this).closest('h3').find('.editor a'); 20 | location.href = editor.attr('href'); 21 | e.preventDefault(); 22 | } 23 | }); 24 | 25 | $('#summary .details > a').live('click', function (e) { 26 | if (e.button == 0 && e.shiftKey) { 27 | var editor = $(this).closest('.details').find('.editor a'); 28 | location.href = editor.attr('href'); 29 | e.preventDefault(); 30 | } 31 | }); 32 | -------------------------------------------------------------------------------- /HttpPHPUnit/assets/js/structure.js: -------------------------------------------------------------------------------- 1 | var structure = $('#structure'); 2 | var opened = $('#structure .node.open, #structure > ul'); 3 | $('> ul', opened.closest('li, #structure')).show(); 4 | opened.parents('ul').show(); 5 | structure.find('.node').disableTextSelect(); // zabrání označení položky při dvojkliku 6 | structure.treeview(); 7 | $('img.structure-placeholder', structure).hide(); 8 | 9 | $('#structure .node a.name').click(function (e) { 10 | if (!e.button && !e.shiftKey) { 11 | $(this).closest('li').find('> .hitarea').trigger('click'); 12 | e.preventDefault(); 13 | } 14 | }); 15 | 16 | $('#structure .node a.name').dblclick(function (e) { 17 | location.href = this.href; 18 | var t = $(this); 19 | if ($('> ul', t.closest('li')).is(':hidden')) 20 | { 21 | t.click(); 22 | } 23 | }); 24 | -------------------------------------------------------------------------------- /HttpPHPUnit/assets/plugins/jQuery.TreeView/images/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Clevis/HttpPHPUnit/f81b85c5b6e2e44885534720f6189517f6e6d7e6/HttpPHPUnit/assets/plugins/jQuery.TreeView/images/ajax-loader.gif -------------------------------------------------------------------------------- /HttpPHPUnit/assets/plugins/jQuery.TreeView/images/file.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Clevis/HttpPHPUnit/f81b85c5b6e2e44885534720f6189517f6e6d7e6/HttpPHPUnit/assets/plugins/jQuery.TreeView/images/file.gif -------------------------------------------------------------------------------- /HttpPHPUnit/assets/plugins/jQuery.TreeView/images/folder-closed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Clevis/HttpPHPUnit/f81b85c5b6e2e44885534720f6189517f6e6d7e6/HttpPHPUnit/assets/plugins/jQuery.TreeView/images/folder-closed.gif -------------------------------------------------------------------------------- /HttpPHPUnit/assets/plugins/jQuery.TreeView/images/folder.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Clevis/HttpPHPUnit/f81b85c5b6e2e44885534720f6189517f6e6d7e6/HttpPHPUnit/assets/plugins/jQuery.TreeView/images/folder.gif -------------------------------------------------------------------------------- /HttpPHPUnit/assets/plugins/jQuery.TreeView/images/minus.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Clevis/HttpPHPUnit/f81b85c5b6e2e44885534720f6189517f6e6d7e6/HttpPHPUnit/assets/plugins/jQuery.TreeView/images/minus.gif -------------------------------------------------------------------------------- /HttpPHPUnit/assets/plugins/jQuery.TreeView/images/plus.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Clevis/HttpPHPUnit/f81b85c5b6e2e44885534720f6189517f6e6d7e6/HttpPHPUnit/assets/plugins/jQuery.TreeView/images/plus.gif -------------------------------------------------------------------------------- /HttpPHPUnit/assets/plugins/jQuery.TreeView/images/treeview-black-line.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Clevis/HttpPHPUnit/f81b85c5b6e2e44885534720f6189517f6e6d7e6/HttpPHPUnit/assets/plugins/jQuery.TreeView/images/treeview-black-line.gif -------------------------------------------------------------------------------- /HttpPHPUnit/assets/plugins/jQuery.TreeView/images/treeview-black.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Clevis/HttpPHPUnit/f81b85c5b6e2e44885534720f6189517f6e6d7e6/HttpPHPUnit/assets/plugins/jQuery.TreeView/images/treeview-black.gif -------------------------------------------------------------------------------- /HttpPHPUnit/assets/plugins/jQuery.TreeView/images/treeview-default-line.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Clevis/HttpPHPUnit/f81b85c5b6e2e44885534720f6189517f6e6d7e6/HttpPHPUnit/assets/plugins/jQuery.TreeView/images/treeview-default-line.gif -------------------------------------------------------------------------------- /HttpPHPUnit/assets/plugins/jQuery.TreeView/images/treeview-default.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Clevis/HttpPHPUnit/f81b85c5b6e2e44885534720f6189517f6e6d7e6/HttpPHPUnit/assets/plugins/jQuery.TreeView/images/treeview-default.gif -------------------------------------------------------------------------------- /HttpPHPUnit/assets/plugins/jQuery.TreeView/images/treeview-famfamfam-line.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Clevis/HttpPHPUnit/f81b85c5b6e2e44885534720f6189517f6e6d7e6/HttpPHPUnit/assets/plugins/jQuery.TreeView/images/treeview-famfamfam-line.gif -------------------------------------------------------------------------------- /HttpPHPUnit/assets/plugins/jQuery.TreeView/images/treeview-famfamfam.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Clevis/HttpPHPUnit/f81b85c5b6e2e44885534720f6189517f6e6d7e6/HttpPHPUnit/assets/plugins/jQuery.TreeView/images/treeview-famfamfam.gif -------------------------------------------------------------------------------- /HttpPHPUnit/assets/plugins/jQuery.TreeView/images/treeview-gray-line.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Clevis/HttpPHPUnit/f81b85c5b6e2e44885534720f6189517f6e6d7e6/HttpPHPUnit/assets/plugins/jQuery.TreeView/images/treeview-gray-line.gif -------------------------------------------------------------------------------- /HttpPHPUnit/assets/plugins/jQuery.TreeView/images/treeview-gray.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Clevis/HttpPHPUnit/f81b85c5b6e2e44885534720f6189517f6e6d7e6/HttpPHPUnit/assets/plugins/jQuery.TreeView/images/treeview-gray.gif -------------------------------------------------------------------------------- /HttpPHPUnit/assets/plugins/jQuery.TreeView/images/treeview-red-line.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Clevis/HttpPHPUnit/f81b85c5b6e2e44885534720f6189517f6e6d7e6/HttpPHPUnit/assets/plugins/jQuery.TreeView/images/treeview-red-line.gif -------------------------------------------------------------------------------- /HttpPHPUnit/assets/plugins/jQuery.TreeView/images/treeview-red.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Clevis/HttpPHPUnit/f81b85c5b6e2e44885534720f6189517f6e6d7e6/HttpPHPUnit/assets/plugins/jQuery.TreeView/images/treeview-red.gif -------------------------------------------------------------------------------- /HttpPHPUnit/init.php: -------------------------------------------------------------------------------- 1 | register(); 8 | 9 | set_time_limit(0); 10 | ini_set('memory_limit', '1G'); 11 | if (extension_loaded('xdebug')) xdebug_disable(); 12 | 13 | /** bc */ 14 | class HttpPHPUnit extends Main 15 | { 16 | 17 | } 18 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "petrp/httpphpunit", 3 | "description": "HttpPHPUnit - Tool for running PHPUnit tests in web browser.", 4 | "homepage": "https://github.com/PetrP/HttpPHPUnit", 5 | "license": "BSD-3-Clause", 6 | "authors": [ 7 | { 8 | "name": "Petr Procházka", 9 | "email": "prochazkapp@gmail.com", 10 | "homepage": "http://petrp.cz" 11 | }, 12 | { 13 | "name": "Jan Tvrdík", 14 | "homepage": "http://merxes.cz" 15 | } 16 | ], 17 | "autoload": { 18 | "files": ["HttpPHPUnit/init.php"] 19 | }, 20 | "require": { 21 | "php": ">=5.3.0", 22 | "phpunit/phpunit": ">=3.5.0", 23 | "phpunit/php-code-coverage": ">=1.0.0" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /libs/Nette/Application/Diagnostics/templates/RoutingPanel.tab.phtml: -------------------------------------------------------------------------------- 1 | 9 | request)): ?>no routerequest->getPresenterName() . ':' . (isset($this->request->parameters[Presenter::ACTION_KEY]) ? $this->request->parameters[Presenter::ACTION_KEY] : Presenter::DEFAULT_ACTION) . (isset($this->request->parameters[Presenter::SIGNAL_KEY]) ? " {$this->request->parameters[Presenter::SIGNAL_KEY]}!" : '')); endif ?> 11 | -------------------------------------------------------------------------------- /libs/Nette/Application/IPresenter.php: -------------------------------------------------------------------------------- 1 | 22 | */ 23 | interface IPresenterFactory 24 | { 25 | 26 | /** 27 | * @param string presenter name 28 | * @return string class name 29 | * @throws InvalidPresenterException 30 | */ 31 | function getPresenterClass(& $name); 32 | 33 | /** 34 | * Create new presenter instance. 35 | * @param string presenter name 36 | * @return IPresenter 37 | */ 38 | function createPresenter($name); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /libs/Nette/Application/IResponse.php: -------------------------------------------------------------------------------- 1 | request = $request; 35 | } 36 | 37 | 38 | 39 | /** 40 | * @return Nette\Application\Request 41 | */ 42 | final public function getRequest() 43 | { 44 | return $this->request; 45 | } 46 | 47 | 48 | 49 | /** 50 | * Sends response to output. 51 | * @return void 52 | */ 53 | public function send(Nette\Http\IRequest $httpRequest, Nette\Http\IResponse $httpResponse) 54 | { 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /libs/Nette/Application/Responses/JsonResponse.php: -------------------------------------------------------------------------------- 1 | payload = $payload; 46 | $this->contentType = $contentType ? $contentType : 'application/json'; 47 | } 48 | 49 | 50 | 51 | /** 52 | * @return array|\stdClass 53 | */ 54 | final public function getPayload() 55 | { 56 | return $this->payload; 57 | } 58 | 59 | 60 | 61 | /** 62 | * Returns the MIME content type of a downloaded file. 63 | * @return string 64 | */ 65 | final public function getContentType() 66 | { 67 | return $this->contentType; 68 | } 69 | 70 | 71 | 72 | /** 73 | * Sends response to output. 74 | * @return void 75 | */ 76 | public function send(Nette\Http\IRequest $httpRequest, Nette\Http\IResponse $httpResponse) 77 | { 78 | $httpResponse->setContentType($this->contentType); 79 | $httpResponse->setExpiration(FALSE); 80 | echo Nette\Utils\Json::encode($this->payload); 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /libs/Nette/Application/Responses/RedirectResponse.php: -------------------------------------------------------------------------------- 1 | url = (string) $url; 44 | $this->code = (int) $code; 45 | } 46 | 47 | 48 | 49 | /** 50 | * @return string 51 | */ 52 | final public function getUrl() 53 | { 54 | return $this->url; 55 | } 56 | 57 | 58 | 59 | /** 60 | * @return int 61 | */ 62 | final public function getCode() 63 | { 64 | return $this->code; 65 | } 66 | 67 | 68 | 69 | /** 70 | * Sends response to output. 71 | * @return void 72 | */ 73 | public function send(Http\IRequest $httpRequest, Http\IResponse $httpResponse) 74 | { 75 | $httpResponse->redirect($this->url, $this->code); 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /libs/Nette/Application/Responses/TextResponse.php: -------------------------------------------------------------------------------- 1 | source = $source; 38 | } 39 | 40 | 41 | 42 | /** 43 | * @return mixed 44 | */ 45 | final public function getSource() 46 | { 47 | return $this->source; 48 | } 49 | 50 | 51 | 52 | /** 53 | * Sends response to output. 54 | * @return void 55 | */ 56 | public function send(Nette\Http\IRequest $httpRequest, Nette\Http\IResponse $httpResponse) 57 | { 58 | if ($this->source instanceof Nette\Templating\ITemplate) { 59 | $this->source->render(); 60 | 61 | } else { 62 | echo $this->source; 63 | } 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /libs/Nette/Application/UI/BadSignalException.php: -------------------------------------------------------------------------------- 1 | factory = new Nette\Callback($factory); 33 | } 34 | 35 | 36 | 37 | protected function createComponent($name) 38 | { 39 | return $this->factory->invoke($name, $this); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /libs/Nette/Application/exceptions.php: -------------------------------------------------------------------------------- 1 | 504) { 58 | $code = $this->defaultCode; 59 | } 60 | 61 | { 62 | parent::__construct($message, $code, $previous); 63 | } 64 | } 65 | 66 | } 67 | 68 | 69 | 70 | /** 71 | * Forbidden request exception - access denied. 72 | */ 73 | class ForbiddenRequestException extends BadRequestException 74 | { 75 | /** @var int */ 76 | protected $defaultCode = 403; 77 | 78 | } 79 | -------------------------------------------------------------------------------- /libs/Nette/Application/templates/error.phtml: -------------------------------------------------------------------------------- 1 | array('Oops...', 'Your browser sent a request that this server could not understand or process.'), 12 | 403 => array('Access Denied', 'You do not have permission to view this page. Please try contact the web site administrator if you believe you should be able to view this page.'), 13 | 404 => array('Page Not Found', 'The page you requested could not be found. It is possible that the address is incorrect, or that the page no longer exists. Please use a search engine to find what you are looking for.'), 14 | 405 => array('Method Not Allowed', 'The requested method is not allowed for the URL.'), 15 | 410 => array('Page Not Found', 'The page you requested has been taken off the site. We apologize for the inconvenience.'), 16 | 500 => array('Server Error', 'We\'re sorry! The server encountered an internal error and was unable to complete your request. Please try again later.'), 17 | ); 18 | $message = isset($messages[$code]) ? $messages[$code] : $messages[0]; 19 | 20 | ?> 21 | 22 | 23 | 24 | 25 | 26 | <?php echo $message[0] ?> 27 | 28 |

29 | 30 |

31 | 32 |

error

33 | -------------------------------------------------------------------------------- /libs/Nette/Caching/IStorage.php: -------------------------------------------------------------------------------- 1 | cache = $cache; 39 | $this->key = $key; 40 | ob_start(); 41 | } 42 | 43 | 44 | 45 | /** 46 | * Stops and saves the cache. 47 | * @param array dependencies 48 | * @return void 49 | */ 50 | public function end(array $dp = NULL) 51 | { 52 | if ($this->cache === NULL) { 53 | throw new Nette\InvalidStateException('Output cache has already been saved.'); 54 | } 55 | $this->cache->save($this->key, ob_get_flush(), (array) $dp + (array) $this->dependencies); 56 | $this->cache = NULL; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /libs/Nette/Caching/Storages/DevNullStorage.php: -------------------------------------------------------------------------------- 1 | data[$key]) ? $this->data[$key] : NULL; 38 | } 39 | 40 | 41 | 42 | /** 43 | * Prevents item reading and writing. Lock is released by write() or remove(). 44 | * @param string key 45 | * @return void 46 | */ 47 | public function lock($key) 48 | { 49 | } 50 | 51 | 52 | 53 | /** 54 | * Writes item into the cache. 55 | * @param string key 56 | * @param mixed data 57 | * @param array dependencies 58 | * @return void 59 | */ 60 | public function write($key, $data, array $dp) 61 | { 62 | $this->data[$key] = $data; 63 | } 64 | 65 | 66 | 67 | /** 68 | * Removes item from the cache. 69 | * @param string key 70 | * @return void 71 | */ 72 | public function remove($key) 73 | { 74 | unset($this->data[$key]); 75 | } 76 | 77 | 78 | 79 | /** 80 | * Removes items from the cache by conditions & garbage collector. 81 | * @param array conditions 82 | * @return void 83 | */ 84 | public function clean(array $conds) 85 | { 86 | if (!empty($conds[Nette\Caching\Cache::ALL])) { 87 | $this->data = array(); 88 | } 89 | } 90 | 91 | } 92 | -------------------------------------------------------------------------------- /libs/Nette/Caching/Storages/PhpFileStorage.php: -------------------------------------------------------------------------------- 1 | $meta[self::FILE], 38 | 'handle' => $meta[self::HANDLE], 39 | ); 40 | } 41 | 42 | 43 | 44 | /** 45 | * Returns file name. 46 | * @param string 47 | * @return string 48 | */ 49 | protected function getCacheFile($key) 50 | { 51 | return parent::getCacheFile(substr_replace( 52 | $key, 53 | trim(strtr($this->hint, '\\/@', '.._'), '.') . '-', 54 | strpos($key, Nette\Caching\Cache::NAMESPACE_SEPARATOR) + 1, 55 | 0 56 | )) . '.php'; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /libs/Nette/ComponentModel/IComponent.php: -------------------------------------------------------------------------------- 1 | current() instanceof IContainer; 34 | } 35 | 36 | 37 | 38 | /** 39 | * The sub-iterator for the current element. 40 | * @return \RecursiveIterator 41 | */ 42 | public function getChildren() 43 | { 44 | return $this->current()->getComponents(); 45 | } 46 | 47 | 48 | 49 | /** 50 | * Returns the count of elements. 51 | * @return int 52 | */ 53 | public function count() 54 | { 55 | return iterator_count($this); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /libs/Nette/Config/Adapters/PhpAdapter.php: -------------------------------------------------------------------------------- 1 | getConfig() as $name => $value) { 30 | $class->methods['initialize']->addBody('define(?, ?);', array($name, $value)); 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /libs/Nette/Config/Extensions/PhpExtension.php: -------------------------------------------------------------------------------- 1 | methods['initialize']; 30 | foreach ($this->getConfig() as $name => $value) { 31 | if (!is_scalar($value)) { 32 | throw new Nette\InvalidStateException("Configuration value for directive '$name' is not scalar."); 33 | 34 | } elseif ($name === 'include_path') { 35 | $initialize->addBody('set_include_path(?);', array(str_replace(';', PATH_SEPARATOR, $value))); 36 | 37 | } elseif ($name === 'ignore_user_abort') { 38 | $initialize->addBody('ignore_user_abort(?);', array($value)); 39 | 40 | } elseif ($name === 'max_execution_time') { 41 | $initialize->addBody('set_time_limit(?);', array($value)); 42 | 43 | } elseif ($name === 'date.timezone') { 44 | $initialize->addBody('date_default_timezone_set(?);', array($value)); 45 | 46 | } elseif (function_exists('ini_set')) { 47 | $initialize->addBody('ini_set(?, ?);', array($name, $value)); 48 | 49 | } elseif (ini_get($name) != $value) { // intentionally == 50 | throw new Nette\NotSupportedException('Required function ini_set() is disabled.'); 51 | } 52 | } 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /libs/Nette/Config/Helpers.php: -------------------------------------------------------------------------------- 1 | $val) { 37 | if (is_int($key)) { 38 | $right[] = $val; 39 | } else { 40 | if (is_array($val) && isset($val[self::EXTENDS_KEY])) { 41 | if ($val[self::EXTENDS_KEY] === self::OVERWRITE) { 42 | unset($val[self::EXTENDS_KEY]); 43 | } 44 | } elseif (isset($right[$key])) { 45 | $val = static::merge($val, $right[$key]); 46 | } 47 | $right[$key] = $val; 48 | } 49 | } 50 | return $right; 51 | 52 | } elseif ($left === NULL && is_array($right)) { 53 | return $right; 54 | 55 | } else { 56 | return $left; 57 | } 58 | } 59 | 60 | 61 | 62 | /** 63 | * Finds out and removes information about the parent. 64 | * @return mixed 65 | */ 66 | public static function takeParent(& $data) 67 | { 68 | if (is_array($data) && isset($data[self::EXTENDS_KEY])) { 69 | $parent = $data[self::EXTENDS_KEY]; 70 | unset($data[self::EXTENDS_KEY]); 71 | return $parent; 72 | } 73 | } 74 | 75 | 76 | 77 | /** 78 | * @return bool 79 | */ 80 | public static function isOverwriting(& $data) 81 | { 82 | return is_array($data) && isset($data[self::EXTENDS_KEY]) && $data[self::EXTENDS_KEY] === self::OVERWRITE; 83 | } 84 | 85 | 86 | 87 | /** 88 | * @return bool 89 | */ 90 | public static function isInheriting(& $data) 91 | { 92 | return is_array($data) && isset($data[self::EXTENDS_KEY]) && $data[self::EXTENDS_KEY] !== self::OVERWRITE; 93 | } 94 | 95 | } 96 | -------------------------------------------------------------------------------- /libs/Nette/Config/IAdapter.php: -------------------------------------------------------------------------------- 1 | 8 |   10 | -------------------------------------------------------------------------------- /libs/Nette/DI/IContainer.php: -------------------------------------------------------------------------------- 1 | container = $container; 40 | $this->namespace = $namespace . '.'; 41 | $this->parameters = & $container->parameters[$namespace]; 42 | } 43 | 44 | 45 | 46 | /** 47 | * @return object 48 | */ 49 | public function __call($name, $args) 50 | { 51 | if (substr($name, 0, 6) === 'create') { 52 | return call_user_func_array(array( 53 | $this->container, 54 | Container::getMethodName($this->namespace . substr($name, 6), FALSE) 55 | ), $args); 56 | } 57 | throw new Nette\NotSupportedException; 58 | } 59 | 60 | 61 | 62 | /** 63 | * @return object 64 | */ 65 | public function &__get($name) 66 | { 67 | $service = $this->container->getService($this->namespace . $name); 68 | return $service; 69 | } 70 | 71 | 72 | 73 | /** 74 | * @return void 75 | */ 76 | public function __set($name, $service) 77 | { 78 | throw new Nette\NotSupportedException; 79 | } 80 | 81 | 82 | 83 | /** 84 | * @return bool 85 | */ 86 | public function __isset($name) 87 | { 88 | return $this->container->hasService($this->namespace . $name); 89 | } 90 | 91 | 92 | 93 | /** 94 | * @return void 95 | */ 96 | public function __unset($name) 97 | { 98 | throw new Nette\NotSupportedException; 99 | } 100 | 101 | } 102 | -------------------------------------------------------------------------------- /libs/Nette/DI/Statement.php: -------------------------------------------------------------------------------- 1 | entity = $entity; 36 | $this->arguments = $arguments; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /libs/Nette/DI/exceptions.php: -------------------------------------------------------------------------------- 1 | $value) { 49 | unset($row[$key]); 50 | if ($key[0] === '[' || $key[0] === '"') { 51 | $key = substr($key, 1, -1); 52 | } 53 | $row[$key] = $value; 54 | } 55 | return $row; 56 | } 57 | 58 | 59 | 60 | /** 61 | * Returns metadata for all foreign keys in a table. 62 | */ 63 | public function getForeignKeys($table) 64 | { 65 | throw new NotSupportedException; // @see http://www.sqlite.org/foreignkeys.html 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /libs/Nette/Database/IReflection.php: -------------------------------------------------------------------------------- 1 | , %2$s for table name 42 | * @param string %1$s stands for key used after ->, %2$s for table name 43 | */ 44 | public function __construct($primary = 'id', $foreign = '%s_id', $table = '%s') 45 | { 46 | $this->primary = $primary; 47 | $this->foreign = $foreign; 48 | $this->table = $table; 49 | } 50 | 51 | 52 | 53 | public function getPrimary($table) 54 | { 55 | return sprintf($this->primary, $this->getColumnFromTable($table)); 56 | } 57 | 58 | 59 | 60 | public function getHasManyReference($table, $key) 61 | { 62 | $table = $this->getColumnFromTable($table); 63 | return array( 64 | sprintf($this->table, $key, $table), 65 | sprintf($this->foreign, $table, $key), 66 | ); 67 | } 68 | 69 | 70 | 71 | public function getBelongsToReference($table, $key) 72 | { 73 | $table = $this->getColumnFromTable($table); 74 | return array( 75 | sprintf($this->table, $key, $table), 76 | sprintf($this->foreign, $key, $table), 77 | ); 78 | } 79 | 80 | 81 | 82 | public function setConnection(Nette\Database\Connection $connection) 83 | {} 84 | 85 | 86 | 87 | protected function getColumnFromTable($name) 88 | { 89 | if ($this->table !== '%s' && preg_match('(^' . str_replace('%s', '(.*)', preg_quote($this->table)) . '$)', $name, $match)) { 90 | return $match[1]; 91 | } 92 | 93 | return $name; 94 | } 95 | 96 | } 97 | -------------------------------------------------------------------------------- /libs/Nette/Database/Row.php: -------------------------------------------------------------------------------- 1 | normalizeRow($this); 29 | } 30 | 31 | 32 | 33 | /** 34 | * Returns a item. 35 | * @param mixed key or index 36 | * @return mixed 37 | */ 38 | public function offsetGet($key) 39 | { 40 | if (is_int($key)) { 41 | $arr = array_values((array) $this); 42 | return $arr[$key]; 43 | } 44 | return $this->$key; 45 | } 46 | 47 | 48 | 49 | public function offsetExists($key) 50 | { 51 | if (is_int($key)) { 52 | $arr = array_values((array) $this); 53 | return isset($arr[$key]); 54 | } 55 | return parent::offsetExists($key); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /libs/Nette/Database/SqlLiteral.php: -------------------------------------------------------------------------------- 1 | value = (string) $value; 32 | } 33 | 34 | 35 | 36 | /** 37 | * @return string 38 | */ 39 | public function __toString() 40 | { 41 | return $this->value; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /libs/Nette/Diagnostics/Bar.php: -------------------------------------------------------------------------------- 1 | panels[$id])); 43 | } 44 | $this->panels[$id] = $panel; 45 | return $this; 46 | } 47 | 48 | 49 | 50 | /** 51 | * Renders debug bar. 52 | * @return void 53 | */ 54 | public function render() 55 | { 56 | $obLevel = ob_get_level(); 57 | $panels = array(); 58 | foreach ($this->panels as $id => $panel) { 59 | try { 60 | $panels[] = array( 61 | 'id' => preg_replace('#[^a-z0-9]+#i', '-', $id), 62 | 'tab' => $tab = (string) $panel->getTab(), 63 | 'panel' => $tab ? (string) $panel->getPanel() : NULL, 64 | ); 65 | } catch (\Exception $e) { 66 | $panels[] = array( 67 | 'id' => "error-" . preg_replace('#[^a-z0-9]+#i', '-', $id), 68 | 'tab' => "Error in $id", 69 | 'panel' => '

Error: ' . $id . '

' . nl2br(htmlSpecialChars($e)) . '
', 70 | ); 71 | while (ob_get_level() > $obLevel) { // restore ob-level if broken 72 | ob_end_clean(); 73 | } 74 | } 75 | } 76 | require __DIR__ . '/templates/bar.phtml'; 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /libs/Nette/Diagnostics/DefaultBarPanel.php: -------------------------------------------------------------------------------- 1 | id = $id; 34 | } 35 | 36 | 37 | 38 | /** 39 | * Renders HTML code for custom tab. 40 | * @return string 41 | */ 42 | public function getTab() 43 | { 44 | ob_start(); 45 | $data = $this->data; 46 | if ($this->id === 'time') { 47 | require __DIR__ . '/templates/bar.time.tab.phtml'; 48 | } elseif ($this->id === 'memory') { 49 | require __DIR__ . '/templates/bar.memory.tab.phtml'; 50 | } elseif ($this->id === 'dumps' && $this->data) { 51 | require __DIR__ . '/templates/bar.dumps.tab.phtml'; 52 | } elseif ($this->id === 'errors' && $this->data) { 53 | require __DIR__ . '/templates/bar.errors.tab.phtml'; 54 | } 55 | return ob_get_clean(); 56 | } 57 | 58 | 59 | 60 | /** 61 | * Renders HTML code for custom panel. 62 | * @return string 63 | */ 64 | public function getPanel() 65 | { 66 | ob_start(); 67 | $data = $this->data; 68 | if ($this->id === 'dumps') { 69 | require __DIR__ . '/templates/bar.dumps.panel.phtml'; 70 | } elseif ($this->id === 'errors') { 71 | require __DIR__ . '/templates/bar.errors.panel.phtml'; 72 | } 73 | return ob_get_clean(); 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /libs/Nette/Diagnostics/IBarPanel.php: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 |

Dumped variables

19 | 20 |
21 | 22 | 23 |

24 | 25 | 26 | 27 | 28 | $dump): ?> 29 | 30 | 31 | 32 | 33 | 34 |
35 | 36 |
37 | -------------------------------------------------------------------------------- /libs/Nette/Diagnostics/templates/bar.dumps.tab.phtml: -------------------------------------------------------------------------------- 1 | 14 | variables 15 | -------------------------------------------------------------------------------- /libs/Nette/Diagnostics/templates/bar.errors.panel.phtml: -------------------------------------------------------------------------------- 1 | 14 |

Errors

15 | 16 |
17 | 18 | 19 | $count): list($message, $file, $line) = explode('|', $item) ?> 20 | 21 | 22 | 23 | 24 | 25 |
26 |
27 | -------------------------------------------------------------------------------- /libs/Nette/Diagnostics/templates/bar.errors.tab.phtml: -------------------------------------------------------------------------------- 1 | 14 | errors 16 | -------------------------------------------------------------------------------- /libs/Nette/Diagnostics/templates/bar.memory.tab.phtml: -------------------------------------------------------------------------------- 1 | 14 | MB 16 | -------------------------------------------------------------------------------- /libs/Nette/Diagnostics/templates/bar.time.tab.phtml: -------------------------------------------------------------------------------- 1 | 14 | ms 16 | -------------------------------------------------------------------------------- /libs/Nette/Diagnostics/templates/error.phtml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | 15 | Server Error 16 | 17 |

Server Error

18 | 19 |

We're sorry! The server encountered an internal error and was unable to complete your request. Please try again later.

20 | 21 |

error 500

22 | -------------------------------------------------------------------------------- /libs/Nette/Forms/Controls/Button.php: -------------------------------------------------------------------------------- 1 | control->type = 'button'; 33 | } 34 | 35 | 36 | 37 | /** 38 | * Bypasses label generation. 39 | * @return void 40 | */ 41 | public function getLabel($caption = NULL) 42 | { 43 | return NULL; 44 | } 45 | 46 | 47 | 48 | /** 49 | * Generates control's HTML element. 50 | * @param string 51 | * @return Nette\Utils\Html 52 | */ 53 | public function getControl($caption = NULL) 54 | { 55 | $control = parent::getControl(); 56 | $control->value = $this->translate($caption === NULL ? $this->caption : $caption); 57 | return $control; 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /libs/Nette/Forms/Controls/Checkbox.php: -------------------------------------------------------------------------------- 1 | control->type = 'checkbox'; 33 | $this->value = FALSE; 34 | } 35 | 36 | 37 | 38 | /** 39 | * Sets control's value. 40 | * @param bool 41 | * @return Checkbox provides a fluent interface 42 | */ 43 | public function setValue($value) 44 | { 45 | $this->value = is_scalar($value) ? (bool) $value : FALSE; 46 | return $this; 47 | } 48 | 49 | 50 | 51 | /** 52 | * Generates control's HTML element. 53 | * @return Nette\Utils\Html 54 | */ 55 | public function getControl() 56 | { 57 | return parent::getControl()->checked($this->value); 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /libs/Nette/Forms/Controls/HiddenField.php: -------------------------------------------------------------------------------- 1 | control->type = 'hidden'; 34 | $this->value = (string) $forcedValue; 35 | $this->forcedValue = $forcedValue; 36 | } 37 | 38 | 39 | 40 | /** 41 | * Bypasses label generation. 42 | * @return void 43 | */ 44 | public function getLabel($caption = NULL) 45 | { 46 | return NULL; 47 | } 48 | 49 | 50 | 51 | /** 52 | * Sets control's value. 53 | * @param string 54 | * @return HiddenField provides a fluent interface 55 | */ 56 | public function setValue($value) 57 | { 58 | $this->value = is_scalar($value) ? (string) $value : ''; 59 | return $this; 60 | } 61 | 62 | 63 | 64 | /** 65 | * Generates control's HTML element. 66 | * @return Nette\Utils\Html 67 | */ 68 | public function getControl() 69 | { 70 | return parent::getControl() 71 | ->value($this->forcedValue === NULL ? $this->value : $this->forcedValue) 72 | ->data('nette-rules', NULL); 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /libs/Nette/Forms/Controls/ImageButton.php: -------------------------------------------------------------------------------- 1 | control->type = 'image'; 34 | $this->control->src = $src; 35 | $this->control->alt = $alt; 36 | } 37 | 38 | 39 | 40 | /** 41 | * Returns HTML name of control. 42 | * @return string 43 | */ 44 | public function getHtmlName() 45 | { 46 | $name = parent::getHtmlName(); 47 | return strpos($name, '[') === FALSE ? $name : $name . '[]'; 48 | } 49 | 50 | 51 | 52 | /** 53 | * Loads HTTP data. 54 | * @return void 55 | */ 56 | public function loadHttpData() 57 | { 58 | $path = $this->getHtmlName(); // img_x or img['x'] 59 | $path = explode('[', strtr(str_replace(']', '', strpos($path, '[') === FALSE ? $path . '.x' : substr($path, 0, -2)), '.', '_')); 60 | $this->setValue(Nette\Utils\Arrays::get($this->getForm()->getHttpData(), $path, NULL)); 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /libs/Nette/Forms/Controls/TextArea.php: -------------------------------------------------------------------------------- 1 | control->setName('textarea'); 35 | $this->control->cols = $cols; 36 | $this->control->rows = $rows; 37 | $this->value = ''; 38 | } 39 | 40 | 41 | 42 | /** 43 | * Generates control's HTML element. 44 | * @return Nette\Utils\Html 45 | */ 46 | public function getControl() 47 | { 48 | $control = parent::getControl(); 49 | $control->setText($this->getValue() === '' ? $this->translate($this->emptyValue) : $this->value); 50 | return $control; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /libs/Nette/Forms/IControl.php: -------------------------------------------------------------------------------- 1 | 22 | * http://nette.org/admin/script.php/pathinfo/?name=param#fragment 23 | * \_______________/\________/ 24 | * | | 25 | * scriptPath pathInfo 26 | * 27 | * 28 | * - scriptPath: /admin/script.php (or simply /admin/ when script is directory index) 29 | * - pathInfo: /pathinfo/ (additional path information) 30 | * 31 | * @author David Grudl 32 | * 33 | * @property string $scriptPath 34 | * @property-read string $pathInfo 35 | */ 36 | class UrlScript extends Url 37 | { 38 | /** @var string */ 39 | private $scriptPath = '/'; 40 | 41 | 42 | 43 | /** 44 | * Sets the script-path part of URI. 45 | * @param string 46 | * @return UrlScript provides a fluent interface 47 | */ 48 | public function setScriptPath($value) 49 | { 50 | $this->updating(); 51 | $this->scriptPath = (string) $value; 52 | return $this; 53 | } 54 | 55 | 56 | 57 | /** 58 | * Returns the script-path part of URI. 59 | * @return string 60 | */ 61 | public function getScriptPath() 62 | { 63 | return $this->scriptPath; 64 | } 65 | 66 | 67 | 68 | /** 69 | * Returns the base-path. 70 | * @return string 71 | */ 72 | public function getBasePath() 73 | { 74 | $pos = strrpos($this->scriptPath, '/'); 75 | return $pos === FALSE ? '' : substr($this->path, 0, $pos + 1); 76 | } 77 | 78 | 79 | 80 | /** 81 | * Returns the additional path information. 82 | * @return string 83 | */ 84 | public function getPathInfo() 85 | { 86 | return (string) substr($this->path, strlen($this->scriptPath)); 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /libs/Nette/Iterators/Filter.php: -------------------------------------------------------------------------------- 1 | callback = new Nette\Callback($callback); 33 | } 34 | 35 | 36 | 37 | public function accept() 38 | { 39 | return $this->callback->invoke($this); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /libs/Nette/Iterators/InstanceFilter.php: -------------------------------------------------------------------------------- 1 | type = $type; 37 | parent::__construct($iterator); 38 | } 39 | 40 | 41 | 42 | /** 43 | * Expose the current element of the inner iterator? 44 | * @return bool 45 | */ 46 | public function accept() 47 | { 48 | return $this->current() instanceof $this->type; 49 | } 50 | 51 | 52 | 53 | /** 54 | * Returns the count of elements. 55 | * @return int 56 | */ 57 | public function count() 58 | { 59 | return iterator_count($this); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /libs/Nette/Iterators/Mapper.php: -------------------------------------------------------------------------------- 1 | callback = new Nette\Callback($callback); 33 | } 34 | 35 | 36 | 37 | public function current() 38 | { 39 | return $this->callback->invoke(parent::current(), parent::key()); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /libs/Nette/Iterators/RecursiveFilter.php: -------------------------------------------------------------------------------- 1 | callback = $callback === NULL ? NULL : new Nette\Callback($callback); 36 | $this->childrenCallback = $childrenCallback === NULL ? NULL : new Nette\Callback($childrenCallback); 37 | } 38 | 39 | 40 | 41 | public function accept() 42 | { 43 | return $this->callback === NULL || $this->callback->invoke($this); 44 | } 45 | 46 | 47 | 48 | public function hasChildren() 49 | { 50 | return $this->getInnerIterator()->hasChildren() 51 | && ($this->childrenCallback === NULL || $this->childrenCallback->invoke($this)); 52 | } 53 | 54 | 55 | 56 | public function getChildren() 57 | { 58 | return new static($this->getInnerIterator()->getChildren(), $this->callback, $this->childrenCallback); 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /libs/Nette/Iterators/Recursor.php: -------------------------------------------------------------------------------- 1 | current(); 33 | return ($obj instanceof \IteratorAggregate && $obj->getIterator() instanceof \RecursiveIterator) 34 | || $obj instanceof \RecursiveIterator; 35 | } 36 | 37 | 38 | 39 | /** 40 | * The sub-iterator for the current element. 41 | * @return \RecursiveIterator 42 | */ 43 | public function getChildren() 44 | { 45 | $obj = $this->current(); 46 | return $obj instanceof \IteratorAggregate ? $obj->getIterator() : $obj; 47 | } 48 | 49 | 50 | 51 | /** 52 | * Returns the count of elements. 53 | * @return int 54 | */ 55 | public function count() 56 | { 57 | return iterator_count($this); 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /libs/Nette/Latte/Engine.php: -------------------------------------------------------------------------------- 1 | parser = new Parser; 36 | $this->compiler = new Compiler; 37 | $this->compiler->defaultContentType = Compiler::CONTENT_XHTML; 38 | 39 | Macros\CoreMacros::install($this->compiler); 40 | $this->compiler->addMacro('cache', new Macros\CacheMacro($this->compiler)); 41 | Macros\UIMacros::install($this->compiler); 42 | Macros\FormMacros::install($this->compiler); 43 | } 44 | 45 | 46 | 47 | /** 48 | * Invokes filter. 49 | * @param string 50 | * @return string 51 | */ 52 | public function __invoke($s) 53 | { 54 | return $this->compiler->compile($this->parser->parse($s)); 55 | } 56 | 57 | 58 | 59 | /** 60 | * @return Parser 61 | */ 62 | public function getParser() 63 | { 64 | return $this->parser; 65 | } 66 | 67 | 68 | 69 | /** 70 | * @return Compiler 71 | */ 72 | public function getCompiler() 73 | { 74 | return $this->compiler; 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /libs/Nette/Latte/HtmlNode.php: -------------------------------------------------------------------------------- 1 | name = $name; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /libs/Nette/Latte/IMacro.php: -------------------------------------------------------------------------------- 1 | macro = $macro; 80 | $this->name = (string) $name; 81 | $this->modifiers = (string) $modifiers; 82 | $this->parentNode = $parentNode; 83 | $this->htmlNode = $htmlNode; 84 | $this->prefix = $prefix; 85 | $this->tokenizer = new MacroTokenizer($this->args); 86 | $this->data = new \stdClass; 87 | $this->setArgs($args); 88 | } 89 | 90 | 91 | 92 | public function setArgs($args) 93 | { 94 | $this->args = (string) $args; 95 | $this->tokenizer->tokenize($this->args); 96 | } 97 | 98 | } 99 | -------------------------------------------------------------------------------- /libs/Nette/Latte/MacroTokenizer.php: -------------------------------------------------------------------------------- 1 | '\s+', 41 | self::T_COMMENT => '(?s)/\*.*?\*/', 42 | self::T_STRING => Parser::RE_STRING, 43 | self::T_KEYWORD => '(?:true|false|null|and|or|xor|clone|new|instanceof|return|continue|break|[A-Z_][A-Z0-9_]{2,})(?![\w\pL_])', // keyword or const 44 | self::T_CAST => '\((?:expand|string|array|int|integer|float|bool|boolean|object)\)', // type casting 45 | self::T_VARIABLE => '\$[\w\pL_]+', 46 | self::T_NUMBER => '[+-]?[0-9]+(?:\.[0-9]+)?(?:e[0-9]+)?', 47 | self::T_SYMBOL => '[\w\pL_]+(?:-[\w\pL_]+)*', 48 | self::T_CHAR => '::|=>|[^"\']', // =>, any char except quotes 49 | ), 'u'); 50 | $this->ignored = array(self::T_COMMENT, self::T_WHITESPACE); 51 | $this->tokenize($input); 52 | } 53 | 54 | 55 | 56 | /** 57 | * Reads single token (optionally delimited by comma) from string. 58 | * @param string 59 | * @return string 60 | */ 61 | public function fetchWord() 62 | { 63 | $word = $this->fetchUntil(self::T_WHITESPACE, ','); 64 | $this->fetch(','); 65 | $this->fetchAll(self::T_WHITESPACE, self::T_COMMENT); 66 | return $word; 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /libs/Nette/Latte/Token.php: -------------------------------------------------------------------------------- 1 | setHeader('Subject', NULL); 38 | $tmp->setHeader('To', NULL); 39 | 40 | $parts = explode(Message::EOL . Message::EOL, $tmp->generateMessage(), 2); 41 | 42 | Nette\Diagnostics\Debugger::tryError(); 43 | $args = array( 44 | str_replace(Message::EOL, PHP_EOL, $mail->getEncodedHeader('To')), 45 | str_replace(Message::EOL, PHP_EOL, $mail->getEncodedHeader('Subject')), 46 | str_replace(Message::EOL, PHP_EOL, $parts[1]), 47 | str_replace(Message::EOL, PHP_EOL, $parts[0]), 48 | ); 49 | if ($this->commandArgs) { 50 | $args[] = (string) $this->commandArgs; 51 | } 52 | $res = call_user_func_array('mail', $args); 53 | 54 | if (Nette\Diagnostics\Debugger::catchError($e)) { 55 | throw new Nette\InvalidStateException('mail(): ' . $e->getMessage(), 0, $e); 56 | 57 | } elseif (!$res) { 58 | throw new Nette\InvalidStateException('Unable to send email.'); 59 | } 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /libs/Nette/Reflection/Annotation.php: -------------------------------------------------------------------------------- 1 | $v) { 29 | $this->$k = $v; 30 | } 31 | } 32 | 33 | 34 | 35 | /** 36 | * Returns default annotation. 37 | * @return string 38 | */ 39 | public function __toString() 40 | { 41 | return $this->value; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /libs/Nette/Reflection/Extension.php: -------------------------------------------------------------------------------- 1 | getName(); 30 | } 31 | 32 | 33 | 34 | /********************* Reflection layer ****************d*g**/ 35 | 36 | 37 | 38 | public function getClasses() 39 | { 40 | $res = array(); 41 | foreach (parent::getClassNames() as $val) { 42 | $res[$val] = new ClassType($val); 43 | } 44 | return $res; 45 | } 46 | 47 | 48 | 49 | public function getFunctions() 50 | { 51 | foreach ($res = parent::getFunctions() as $key => $val) { 52 | $res[$key] = new GlobalFunction($key); 53 | } 54 | return $res; 55 | } 56 | 57 | 58 | 59 | /********************* Nette\Object behaviour ****************d*g**/ 60 | 61 | 62 | 63 | /** 64 | * @return ClassType 65 | */ 66 | public static function getReflection() 67 | { 68 | return new ClassType(get_called_class()); 69 | } 70 | 71 | 72 | 73 | public function __call($name, $args) 74 | { 75 | return ObjectMixin::call($this, $name, $args); 76 | } 77 | 78 | 79 | 80 | public function &__get($name) 81 | { 82 | return ObjectMixin::get($this, $name); 83 | } 84 | 85 | 86 | 87 | public function __set($name, $value) 88 | { 89 | return ObjectMixin::set($this, $name, $value); 90 | } 91 | 92 | 93 | 94 | public function __isset($name) 95 | { 96 | return ObjectMixin::has($this, $name); 97 | } 98 | 99 | 100 | 101 | public function __unset($name) 102 | { 103 | ObjectMixin::remove($this, $name); 104 | } 105 | 106 | } 107 | -------------------------------------------------------------------------------- /libs/Nette/Reflection/IAnnotation.php: -------------------------------------------------------------------------------- 1 | user = $user; 34 | } 35 | 36 | 37 | 38 | /** 39 | * Renders tab. 40 | * @return string 41 | */ 42 | public function getTab() 43 | { 44 | ob_start(); 45 | require __DIR__ . '/templates/UserPanel.tab.phtml'; 46 | return ob_get_clean(); 47 | } 48 | 49 | 50 | 51 | /** 52 | * Renders panel. 53 | * @return string 54 | */ 55 | public function getPanel() 56 | { 57 | ob_start(); 58 | require __DIR__ . '/templates/UserPanel.panel.phtml'; 59 | return ob_get_clean(); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /libs/Nette/Security/Diagnostics/templates/UserPanel.panel.phtml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 |
12 |

user->isLoggedIn()): ?>Logged inUnlogged

13 | 14 | user->getIdentity()): echo Helpers::clickableDump($this->user->getIdentity()); else: ?>

no identity

15 |
16 | -------------------------------------------------------------------------------- /libs/Nette/Security/Diagnostics/templates/UserPanel.tab.phtml: -------------------------------------------------------------------------------- 1 | 8 | user->isLoggedIn()): ?> 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /libs/Nette/Security/IAuthenticator.php: -------------------------------------------------------------------------------- 1 | password 31 | */ 32 | public function __construct(array $userlist) 33 | { 34 | $this->userlist = $userlist; 35 | } 36 | 37 | 38 | 39 | /** 40 | * Performs an authentication against e.g. database. 41 | * and returns IIdentity on success or throws AuthenticationException 42 | * @param array 43 | * @return IIdentity 44 | * @throws AuthenticationException 45 | */ 46 | public function authenticate(array $credentials) 47 | { 48 | list($username, $password) = $credentials; 49 | foreach ($this->userlist as $name => $pass) { 50 | if (strcasecmp($name, $username) === 0) { 51 | if ((string) $pass === (string) $password) { 52 | return new Identity($name); 53 | } else { 54 | throw new AuthenticationException("Invalid password.", self::INVALID_CREDENTIAL); 55 | } 56 | } 57 | } 58 | throw new AuthenticationException("User '$username' not found.", self::IDENTITY_NOT_FOUND); 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /libs/Nette/Templating/FilterException.php: -------------------------------------------------------------------------------- 1 | sourceLine = (int) $sourceLine; 36 | parent::__construct($message, $code); 37 | } 38 | 39 | 40 | 41 | public function setSourceFile($file) 42 | { 43 | $this->sourceFile = (string) $file; 44 | $this->message = rtrim($this->message, '.') . " in " . str_replace(dirname(dirname($file)), '...', $file) 45 | . ($this->sourceLine ? ":$this->sourceLine" : ''); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /libs/Nette/Templating/IFileTemplate.php: -------------------------------------------------------------------------------- 1 | 1) { 46 | self::$vars = func_get_arg(1); 47 | extract(self::$vars); 48 | } 49 | $res = eval('?>' . func_get_arg(0)); 50 | if ($res === FALSE && ($error = error_get_last()) && $error['type'] === E_PARSE) { 51 | throw new Nette\FatalErrorException($error['message'], 0, $error['type'], $error['file'], $error['line'], NULL); 52 | } 53 | return $res; 54 | } 55 | 56 | 57 | 58 | /** 59 | * Includes script in a limited scope. 60 | * @param string file to include 61 | * @param array local variables or TRUE meaning include once 62 | * @return mixed the return value of the included file 63 | */ 64 | public static function load(/*$file, array $vars = NULL*/) 65 | { 66 | if (func_num_args() > 1) { 67 | self::$vars = func_get_arg(1); 68 | if (self::$vars === TRUE) { 69 | return include_once func_get_arg(0); 70 | } 71 | extract(self::$vars); 72 | } 73 | return include func_get_arg(0); 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /libs/Nette/Utils/MimeTypeDetector.php: -------------------------------------------------------------------------------- 1 | value = (string) $value; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /libs/Nette/Utils/PhpGenerator/Property.php: -------------------------------------------------------------------------------- 1 | format('Y-m-d H:i:s'), $time->getTimezone()); 54 | 55 | } elseif (is_numeric($time)) { 56 | if ($time <= self::YEAR) { 57 | $time += time(); 58 | } 59 | return new static(date('Y-m-d H:i:s', $time)); 60 | 61 | } else { // textual or NULL 62 | return new static($time); 63 | } 64 | } 65 | 66 | 67 | 68 | public function __toString() 69 | { 70 | return $this->format('Y-m-d H:i:s'); 71 | } 72 | 73 | 74 | 75 | public function modifyClone($modify = '') 76 | { 77 | $dolly = clone $this; 78 | return $modify ? $dolly->modify($modify) : $dolly; 79 | } 80 | 81 | 82 | 83 | } 84 | -------------------------------------------------------------------------------- /libs/Nette/common/Framework.php: -------------------------------------------------------------------------------- 1 | frozen = TRUE; 39 | } 40 | 41 | 42 | 43 | /** 44 | * Is the object unmodifiable? 45 | * @return bool 46 | */ 47 | final public function isFrozen() 48 | { 49 | return $this->frozen; 50 | } 51 | 52 | 53 | 54 | /** 55 | * Creates a modifiable clone of the object. 56 | * @return void 57 | */ 58 | public function __clone() 59 | { 60 | $this->frozen = FALSE; 61 | } 62 | 63 | 64 | 65 | /** 66 | * @return void 67 | */ 68 | protected function updating() 69 | { 70 | if ($this->frozen) { 71 | $class = get_class($this); 72 | throw new InvalidStateException("Cannot modify a frozen object $class."); 73 | } 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /libs/Nette/common/IFreezable.php: -------------------------------------------------------------------------------- 1 | register(); 45 | 46 | require_once __DIR__ . '/Diagnostics/Helpers.php'; 47 | require_once __DIR__ . '/Diagnostics/shortcuts.php'; 48 | require_once __DIR__ . '/Utils/Html.php'; 49 | Nette\Diagnostics\Debugger::_init(); 50 | 51 | Nette\Utils\SafeStream::register(); 52 | 53 | 54 | 55 | /** 56 | * Nette\Callback factory. 57 | * @param mixed class, object, callable 58 | * @param string method 59 | * @return Nette\Callback 60 | */ 61 | function callback($callback, $m = NULL) 62 | { 63 | return new Nette\Callback($callback, $m); 64 | } 65 | -------------------------------------------------------------------------------- /libs/PHPUnit/PHP/CodeCoverage/Report/HTML/Template/butter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Clevis/HttpPHPUnit/f81b85c5b6e2e44885534720f6189517f6e6d7e6/libs/PHPUnit/PHP/CodeCoverage/Report/HTML/Template/butter.png -------------------------------------------------------------------------------- /libs/PHPUnit/PHP/CodeCoverage/Report/HTML/Template/chameleon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Clevis/HttpPHPUnit/f81b85c5b6e2e44885534720f6189517f6e6d7e6/libs/PHPUnit/PHP/CodeCoverage/Report/HTML/Template/chameleon.png -------------------------------------------------------------------------------- /libs/PHPUnit/PHP/CodeCoverage/Report/HTML/Template/close12_1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Clevis/HttpPHPUnit/f81b85c5b6e2e44885534720f6189517f6e6d7e6/libs/PHPUnit/PHP/CodeCoverage/Report/HTML/Template/close12_1.gif -------------------------------------------------------------------------------- /libs/PHPUnit/PHP/CodeCoverage/Report/HTML/Template/directory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Clevis/HttpPHPUnit/f81b85c5b6e2e44885534720f6189517f6e6d7e6/libs/PHPUnit/PHP/CodeCoverage/Report/HTML/Template/directory.png -------------------------------------------------------------------------------- /libs/PHPUnit/PHP/CodeCoverage/Report/HTML/Template/directory_item.html.dist: -------------------------------------------------------------------------------- 1 | 2 | {icon}{name} 3 | 4 | 5 | 6 | 7 | 8 |
{lines_executed_percent}{lines_executed_percent}
9 | 10 | {lines_executed_percent} 11 | {num_executed_lines} / {num_executable_lines} 12 | 13 | 14 | 15 | 16 | 17 |
{methods_tested_percent}{methods_tested_percent}
18 | 19 | {methods_tested_percent} 20 | {methods_number} 21 | 22 | 23 | 24 | 25 | 26 |
{classes_tested_percent}{classes_tested_percent}
27 | 28 | {classes_tested_percent} 29 | {classes_number} 30 | 31 | 32 | -------------------------------------------------------------------------------- /libs/PHPUnit/PHP/CodeCoverage/Report/HTML/Template/excanvas.compressed.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Clevis/HttpPHPUnit/f81b85c5b6e2e44885534720f6189517f6e6d7e6/libs/PHPUnit/PHP/CodeCoverage/Report/HTML/Template/excanvas.compressed.js -------------------------------------------------------------------------------- /libs/PHPUnit/PHP/CodeCoverage/Report/HTML/Template/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Clevis/HttpPHPUnit/f81b85c5b6e2e44885534720f6189517f6e6d7e6/libs/PHPUnit/PHP/CodeCoverage/Report/HTML/Template/file.png -------------------------------------------------------------------------------- /libs/PHPUnit/PHP/CodeCoverage/Report/HTML/Template/file_item.html.dist: -------------------------------------------------------------------------------- 1 | 2 | {name} 3 | 4 | 5 | 6 | 7 | 8 |
{classes_tested_percent}{classes_tested_percent}
9 | 10 | {classes_tested_percent} 11 | {classes_number} 12 | 13 | 14 | 15 | 16 | 17 |
{methods_tested_percent}{methods_tested_percent}
18 | 19 | {methods_tested_percent} 20 | {methods_number} 21 | {crap} 22 | 23 | 24 | 25 | 26 | 27 |
{lines_executed_percent}{lines_executed_percent}
28 | 29 | {lines_executed_percent} 30 | {num_executed_lines} / {num_executable_lines} 31 | 32 | 33 | -------------------------------------------------------------------------------- /libs/PHPUnit/PHP/CodeCoverage/Report/HTML/Template/glass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Clevis/HttpPHPUnit/f81b85c5b6e2e44885534720f6189517f6e6d7e6/libs/PHPUnit/PHP/CodeCoverage/Report/HTML/Template/glass.png -------------------------------------------------------------------------------- /libs/PHPUnit/PHP/CodeCoverage/Report/HTML/Template/method_item.html.dist: -------------------------------------------------------------------------------- 1 | 2 | {name} 3 | 4 | 5 | 6 | 7 | 8 |
{methods_tested_percent}{methods_tested_percent}
9 | 10 | {methods_tested_percent} 11 | {methods_number} 12 | {crap} 13 | 14 | 15 | 16 | 17 | 18 |
{lines_executed_percent}{lines_executed_percent}
19 | 20 | {lines_executed_percent} 21 | {num_executed_lines} / {num_executable_lines} 22 | 23 | 24 | -------------------------------------------------------------------------------- /libs/PHPUnit/PHP/CodeCoverage/Report/HTML/Template/scarlet_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Clevis/HttpPHPUnit/f81b85c5b6e2e44885534720f6189517f6e6d7e6/libs/PHPUnit/PHP/CodeCoverage/Report/HTML/Template/scarlet_red.png -------------------------------------------------------------------------------- /libs/PHPUnit/PHP/CodeCoverage/Report/HTML/Template/snow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Clevis/HttpPHPUnit/f81b85c5b6e2e44885534720f6189517f6e6d7e6/libs/PHPUnit/PHP/CodeCoverage/Report/HTML/Template/snow.png -------------------------------------------------------------------------------- /libs/PHPUnit/PHP/CodeCoverage/Report/HTML/Template/yui_item.js: -------------------------------------------------------------------------------- 1 | "panel{line}": { 2 | "header": "{header}", 3 | "body": "", 4 | "footer": "" 5 | }, 6 | -------------------------------------------------------------------------------- /libs/PHPUnit/PHPUnit/Extensions/Story/ResultPrinter/Template/scenario.html.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 |

[+] {name}

4 | 5 | 6 | 7 | 8 | 9 | {steps} 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /libs/PHPUnit/PHPUnit/Extensions/Story/ResultPrinter/Template/scenario_header.html.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 |

{name}

4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /libs/PHPUnit/PHPUnit/Extensions/Story/ResultPrinter/Template/scenarios.html.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | 29 | 30 | 31 | 32 | {scenarios} 33 | 34 | 57 | 58 |
35 |

[+] Summary:

36 | 56 |
59 | 60 | 61 | -------------------------------------------------------------------------------- /libs/PHPUnit/PHPUnit/Extensions/Story/ResultPrinter/Template/step.html.dist: -------------------------------------------------------------------------------- 1 | 2 | {text} 3 | {action} 4 |   5 | 6 | 7 | -------------------------------------------------------------------------------- /libs/PHPUnit/PHPUnit/Framework.php: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @package PHPUnit 38 | * @author Sebastian Bergmann 39 | * @copyright 2002-2011 Sebastian Bergmann 40 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 41 | * @link http://www.phpunit.de/ 42 | * @since File available since Release 3.0.0 43 | */ 44 | 45 | require_once 'PHP/CodeCoverage/Filter.php'; 46 | PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'PHPUNIT'); 47 | 48 | trigger_error( 49 | 'Please no longer include "PHPUnit/Framework.php".', E_USER_NOTICE 50 | ); 51 | -------------------------------------------------------------------------------- /libs/PHPUnit/PHPUnit/Framework/Assert/Functions.php.in: -------------------------------------------------------------------------------- 1 | . 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * Neither the name of Sebastian Bergmann nor the names of his 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 27 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 28 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 29 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | * POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * @package PHPUnit 38 | * @subpackage Framework 39 | * @author Sebastian Bergmann 40 | * @copyright 2002-2011 Sebastian Bergmann 41 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License 42 | * @link http://www.phpunit.de/ 43 | * @since File available since Release 3.5.0 44 | */{functions} 45 | -------------------------------------------------------------------------------- /libs/PHPUnit/PHPUnit/Framework/Process/TestCaseMethod.tpl.dist: -------------------------------------------------------------------------------- 1 | collectRawCodeCoverageInformation({collectCodeCoverageInformation}); 14 | $result->strictMode({strict}); 15 | 16 | $test = new {className}('{methodName}', unserialize('{data}'), '{dataName}'); 17 | $test->setDependencyInput(unserialize('{dependencyInput}')); 18 | $test->setInIsolation(TRUE); 19 | 20 | ob_end_clean(); 21 | ob_start(); 22 | $test->run($result); 23 | $output = ob_get_clean(); 24 | 25 | print serialize( 26 | array( 27 | 'testResult' => $test->getResult(), 28 | 'numAssertions' => $test->getNumAssertions(), 29 | 'result' => $result, 30 | 'output' => $output 31 | ) 32 | ); 33 | 34 | ob_start(); 35 | } 36 | 37 | {constants} 38 | {included_files} 39 | {globals} 40 | 41 | if (isset($GLOBALS['__PHPUNIT_BOOTSTRAP'])) { 42 | require_once $GLOBALS['__PHPUNIT_BOOTSTRAP']; 43 | unset($GLOBALS['__PHPUNIT_BOOTSTRAP']); 44 | } 45 | 46 | __phpunit_run_isolated_test(); 47 | ob_end_clean(); 48 | ?> 49 | -------------------------------------------------------------------------------- /libs/PHPUnit/PHPUnit/Util/Skeleton/Template/Class.tpl.dist: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /libs/PHPUnit/PHPUnit/Util/Skeleton/Template/IncompleteTestMethod.tpl.dist: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * @todo Implement test{methodName}(). 4 | */ 5 | public function test{methodName}() 6 | { 7 | // Remove the following lines when you implement this test. 8 | $this->markTestIncomplete( 9 | 'This test has not been implemented yet.' 10 | ); 11 | } 12 | -------------------------------------------------------------------------------- /libs/PHPUnit/PHPUnit/Util/Skeleton/Template/Method.tpl.dist: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * @todo Implement {methodName}(). 4 | */ 5 | public function {methodName}() 6 | { 7 | // Remove the following line when you implement this method. 8 | throw new RuntimeException('Not yet implemented.'); 9 | } 10 | -------------------------------------------------------------------------------- /libs/PHPUnit/PHPUnit/Util/Skeleton/Template/TestClass.tpl.dist: -------------------------------------------------------------------------------- 1 | object = new {className}; 21 | } 22 | 23 | /** 24 | * Tears down the fixture, for example, closes a network connection. 25 | * This method is called after a test is executed. 26 | */ 27 | protected function tearDown() 28 | { 29 | } 30 | {methods}} 31 | ?> 32 | -------------------------------------------------------------------------------- /libs/PHPUnit/PHPUnit/Util/Skeleton/Template/TestMethod.tpl.dist: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Generated from @assert {annotation}. 4 | */ 5 | public function test{methodName}() 6 | { 7 | $this->assert{assertion}( 8 | {expected}, 9 | $this->object->{origMethodName}({arguments}) 10 | ); 11 | } 12 | -------------------------------------------------------------------------------- /libs/PHPUnit/PHPUnit/Util/Skeleton/Template/TestMethodBool.tpl.dist: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Generated from @assert {annotation}. 4 | */ 5 | public function test{methodName}() 6 | { 7 | $this->assert{assertion}( 8 | $this->object->{origMethodName}({arguments}) 9 | ); 10 | } 11 | -------------------------------------------------------------------------------- /libs/PHPUnit/PHPUnit/Util/Skeleton/Template/TestMethodBoolStatic.tpl.dist: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Generated from @assert {annotation}. 4 | */ 5 | public function test{methodName}() 6 | { 7 | $this->assert{assertion}( 8 | {className}::{origMethodName}({arguments}) 9 | ); 10 | } 11 | -------------------------------------------------------------------------------- /libs/PHPUnit/PHPUnit/Util/Skeleton/Template/TestMethodException.tpl.dist: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Generated from @assert {annotation}. 4 | * @expectedException {expected} 5 | */ 6 | public function test{methodName}() 7 | { 8 | $this->object->{origMethodName}({arguments}); 9 | } 10 | -------------------------------------------------------------------------------- /libs/PHPUnit/PHPUnit/Util/Skeleton/Template/TestMethodExceptionStatic.tpl.dist: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Generated from @assert {annotation}. 4 | * @expectedException {expected} 5 | */ 6 | public function test{methodName}() 7 | { 8 | {className}::{origMethodName}({arguments}); 9 | } 10 | -------------------------------------------------------------------------------- /libs/PHPUnit/PHPUnit/Util/Skeleton/Template/TestMethodStatic.tpl.dist: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Generated from @assert {annotation}. 4 | */ 5 | public function test{methodName}() 6 | { 7 | $this->assert{assertion}( 8 | {expected}, 9 | {className}::{origMethodName}({arguments}) 10 | ); 11 | } 12 | -------------------------------------------------------------------------------- /libs/dump.php: -------------------------------------------------------------------------------- 1 | 1) $var = func_get_args(); 9 | Debugger::dump($var); 10 | return func_get_arg(0); 11 | } 12 | 13 | /** Bar dump */ 14 | function dd($var) 15 | { 16 | if (func_num_args() > 1) $var = func_get_args(); 17 | else if (is_array($var)) $var = array(NULL => $var); 18 | Debugger::barDump($var); 19 | return func_get_arg(0); 20 | } 21 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | enableDebugger(); 8 | $configurator->setTempDirectory( __DIR__ . '/tmp'); 9 | $configurator->createRobotLoader() 10 | ->addDirectory(__DIR__ . '/../libs') 11 | ->addDirectory(__DIR__ . '/cases') 12 | ->register() 13 | ; 14 | 15 | require_once __DIR__ . '/TestCase.php'; 16 | 17 | define('LIBS_DIR', __DIR__ . '/../libs'); 18 | -------------------------------------------------------------------------------- /tests/cases/Config/Config_Configuration_addArgument_Test.php: -------------------------------------------------------------------------------- 1 | c = new HttpPHPUnit\Config\Configuration; 13 | } 14 | 15 | public function test1() 16 | { 17 | $this->c->addArgument('aaa bbb'); 18 | $this->assertSame(array('aaa', 'bbb'), $this->c->getArguments()); 19 | } 20 | 21 | public function test2() 22 | { 23 | $this->c->addArgument('"aaa" "bbb"'); 24 | $this->assertSame(array('aaa', 'bbb'), $this->c->getArguments()); 25 | } 26 | 27 | public function test3() 28 | { 29 | $this->c->addArgument("'aaa' 'bbb'"); 30 | $this->assertSame(array('aaa', 'bbb'), $this->c->getArguments()); 31 | } 32 | 33 | public function test4() 34 | { 35 | $this->c->addArgument('"aaa" \'bbb\' ccc'); 36 | $this->assertSame(array('aaa', 'bbb', 'ccc'), $this->c->getArguments()); 37 | } 38 | 39 | public function test5() 40 | { 41 | $this->c->addArgument('aaa \'bbb\' "ccc"'); 42 | $this->assertSame(array('aaa', 'bbb', 'ccc'), $this->c->getArguments()); 43 | } 44 | 45 | public function test6() 46 | { 47 | $this->c->addArgument('"a aa" \'b bb\' ccc'); 48 | $this->assertSame(array('a aa', 'b bb', 'ccc'), $this->c->getArguments()); 49 | } 50 | 51 | public function test7() 52 | { 53 | $this->c->addArgument('aaa \'b bb\' "c cc"'); 54 | $this->assertSame(array('aaa', 'b bb', 'c cc'), $this->c->getArguments()); 55 | } 56 | 57 | public function test8() 58 | { 59 | $this->c->addArgument('"ss'); 60 | $this->assertSame(array('"ss'), $this->c->getArguments()); 61 | } 62 | 63 | public function test9() 64 | { 65 | $this->c->addArgument('asdas "A\' "\'sdaSD"as ASD" "\'sdaSDas ASD" aS D"as\'d "s\'d;" \'a\'sd\' a\'sd;a\'"sd;\'as; "g"g"'); 66 | $this->assertSame(array( 67 | 'asdas', 68 | '"A\'', 69 | '"\'sdaSD"as', 70 | 'ASD"', 71 | '\'sdaSDas ASD', 72 | 'aS', 73 | 'D"as\'d', 74 | 's\'d;', 75 | '\'a\'sd\'', 76 | 'a\'sd;a\'"sd;\'as;', 77 | '"g"g"', 78 | ), $this->c->getArguments()); 79 | } 80 | 81 | public function testEmpty() 82 | { 83 | $this->setExpectedException('Exception', "Invalid argument: ''"); 84 | $this->c->addArgument(''); 85 | } 86 | 87 | } 88 | -------------------------------------------------------------------------------- /tests/cases/Config/Config_Information_Test.php: -------------------------------------------------------------------------------- 1 | setRunned($runned); 16 | $c->setFilter($filter); 17 | $i = new HttpPHPUnit\Config\Information($c); 18 | $this->assertSame($result, $i->isRunnedAllTest()); 19 | } 20 | 21 | public function dataProviderIsRunnedAllTest() 22 | { 23 | return array( 24 | array(false, NULL, false), 25 | array(false, 'x', false), 26 | array(true, NULL, true), 27 | array(true, 'x', false), 28 | ); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /tests/cases/Loaders/Loaders_AutoLoader_Test.php: -------------------------------------------------------------------------------- 1 | assertInstanceOf('HttpPHPUnit\Loaders\AutoLoader', $i); 13 | $this->assertSame($i, $i); 14 | } 15 | 16 | public function testRegister() 17 | { 18 | $originCount = count(spl_autoload_functions()); 19 | $i = new HttpPHPUnit\Loaders\AutoLoader; 20 | $this->assertFalse(in_array(array($i, 'tryLoad'), spl_autoload_functions(), true)); 21 | $i->register(); 22 | $this->assertSame($originCount + 1, count(spl_autoload_functions())); 23 | $this->assertTrue(in_array(array($i, 'tryLoad'), spl_autoload_functions(), true)); 24 | $tmp = spl_autoload_functions(); 25 | $this->assertSame(array($i, 'tryLoad'), end($tmp)); 26 | $i->unregister(); 27 | $this->assertSame($originCount, count(spl_autoload_functions())); 28 | $this->assertFalse(in_array(array($i, 'tryLoad'), spl_autoload_functions(), true)); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /tests/cases/Loaders/Loaders_IncludePathLoader_Test.php: -------------------------------------------------------------------------------- 1 | includePath = get_include_path(); 15 | } 16 | 17 | protected function tearDown() 18 | { 19 | parent::tearDown(); 20 | set_include_path($this->includePath); 21 | } 22 | 23 | private function assertIncludePath($changed) 24 | { 25 | $ip = get_include_path(); 26 | $ip = str_replace($this->includePath, '...', $ip); 27 | $this->assertSame($changed, $ip); 28 | } 29 | 30 | public function testAutoDetectByIncludePath() 31 | { 32 | $i = new Loaders_IncludePathLoader_Test_Loader; 33 | $i->load(); 34 | $this->assertSame(realpath(LIBS_DIR . '\PHPUnit\PHPUnit\Autoload.php'), $i->include); 35 | $this->assertIncludePath('...'); 36 | } 37 | 38 | public function testAutoDetectByWithoutIncludePath() 39 | { 40 | restore_include_path(); 41 | $i = new Loaders_IncludePathLoader_Test_Loader; 42 | $this->setExpectedException('Exception', 'Unable autodetect PHPUnit: ' . realpath(LIBS_DIR . '/..') . '/PHPUnit/PHPUnit/Autoload.php'); 43 | $i->load(); 44 | } 45 | 46 | public function testSet() 47 | { 48 | $i = new Loaders_IncludePathLoader_Test_Loader(LIBS_DIR . '/PHPUnit'); 49 | $i->load(); 50 | $this->assertSame('PHPUnit/Autoload.php', $i->include); 51 | $this->assertIncludePath(LIBS_DIR . '/PHPUnit' . ';...'); 52 | } 53 | 54 | public function testSetNoDir() 55 | { 56 | $i = new Loaders_IncludePathLoader_Test_Loader(LIBS_DIR . '/PHPUnitX'); 57 | $this->setExpectedException('Exception', 'PHPUnit not found: ' . LIBS_DIR . '/PHPUnitX'); 58 | $i->load(); 59 | } 60 | 61 | public function testSetNoFile() 62 | { 63 | $i = new Loaders_IncludePathLoader_Test_Loader(__DIR__); 64 | $this->setExpectedException('Exception', 'PHPUnit not found: ' . __DIR__ . '/PHPUnit/Autoload.php'); 65 | $i->load(); 66 | } 67 | 68 | } 69 | 70 | class Loaders_IncludePathLoader_Test_Loader extends HttpPHPUnit\Loaders\IncludePathLoader 71 | { 72 | 73 | public $include; 74 | 75 | protected function limitedScopeLoad(/*$file*/) 76 | { 77 | $this->include = func_get_arg(0); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /tests/cases/Main/Main_arg_Test.php: -------------------------------------------------------------------------------- 1 | h = new HttpPHPUnit\Main(new HttpPHPUnit\Loaders\IncludePathLoader(LIBS_DIR . '/PHPUnit')); 13 | } 14 | 15 | public function test1() 16 | { 17 | $this->h->arg('aaa bbb'); 18 | $this->assertSame(array('aaa', 'bbb'), $this->h->configurator->configuration->getArguments()); 19 | } 20 | 21 | public function test2() 22 | { 23 | $this->h->arg('"aaa" "bbb"'); 24 | $this->assertSame(array('aaa', 'bbb'), $this->h->configurator->configuration->getArguments()); 25 | } 26 | 27 | public function test3() 28 | { 29 | $this->h->arg("'aaa' 'bbb'"); 30 | $this->assertSame(array('aaa', 'bbb'), $this->h->configurator->configuration->getArguments()); 31 | } 32 | 33 | public function test4() 34 | { 35 | $this->h->arg('"aaa" \'bbb\' ccc'); 36 | $this->assertSame(array('aaa', 'bbb', 'ccc'), $this->h->configurator->configuration->getArguments()); 37 | } 38 | 39 | public function test5() 40 | { 41 | $this->h->arg('aaa \'bbb\' "ccc"'); 42 | $this->assertSame(array('aaa', 'bbb', 'ccc'), $this->h->configurator->configuration->getArguments()); 43 | } 44 | 45 | public function test6() 46 | { 47 | $this->h->arg('"a aa" \'b bb\' ccc'); 48 | $this->assertSame(array('a aa', 'b bb', 'ccc'), $this->h->configurator->configuration->getArguments()); 49 | } 50 | 51 | public function test7() 52 | { 53 | $this->h->arg('aaa \'b bb\' "c cc"'); 54 | $this->assertSame(array('aaa', 'b bb', 'c cc'), $this->h->configurator->configuration->getArguments()); 55 | } 56 | 57 | public function test8() 58 | { 59 | $this->h->arg('"ss'); 60 | $this->assertSame(array('"ss'), $this->h->configurator->configuration->getArguments()); 61 | } 62 | 63 | public function test9() 64 | { 65 | $this->h->arg('asdas "A\' "\'sdaSD"as ASD" "\'sdaSDas ASD" aS D"as\'d "s\'d;" \'a\'sd\' a\'sd;a\'"sd;\'as; "g"g"'); 66 | $this->assertSame(array( 67 | 'asdas', 68 | '"A\'', 69 | '"\'sdaSD"as', 70 | 'ASD"', 71 | '\'sdaSDas ASD', 72 | 'aS', 73 | 'D"as\'d', 74 | 's\'d;', 75 | '\'a\'sd\'', 76 | 'a\'sd;a\'"sd;\'as;', 77 | '"g"g"', 78 | ), $this->h->configurator->configuration->getArguments()); 79 | } 80 | 81 | public function testEmpty() 82 | { 83 | $this->setExpectedException('Exception', "Invalid argument: ''"); 84 | $this->h->arg(''); 85 | } 86 | 87 | } 88 | -------------------------------------------------------------------------------- /tests/cases/Main/Main_coverage_Test.php: -------------------------------------------------------------------------------- 1 | h = new HttpPHPUnit\Main(new HttpPHPUnit\Loaders\IncludePathLoader(LIBS_DIR . '/PHPUnit')); 13 | } 14 | 15 | public function testSetProcessUncoveredFilesFromWhitelist_True() 16 | { 17 | $test = $this; 18 | $called = false; 19 | 20 | $this->h->coverage(__DIR__, __DIR__, function (PHP_CodeCoverage $coverage) use ($test, & $called) { 21 | $coverage->filter()->removeDirectoryFromWhitelist(__DIR__); 22 | $test->assertAttributeSame(true, 'processUncoveredFilesFromWhitelist', $coverage); 23 | $called = true; 24 | }); 25 | 26 | $a = $this->h->getConfigurator()->createApplication(); 27 | $c = $this->readAttribute($a, 'configuration'); 28 | $c->setFilter(NULL); 29 | $c->isRunned(TRUE); 30 | $e = $this->readAttribute($a, 'events'); 31 | $e->triggerListener('onStart'); 32 | $this->assertSame(true, $called); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /tests/cases/Rendering/NetteDebug_call_Test.php: -------------------------------------------------------------------------------- 1 | assertSame("
\"xxx\" (3)\n
\n", $d->dump('xxx', true)); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /tests/cases/Rendering/NetteDebug_construct_Test.php: -------------------------------------------------------------------------------- 1 | assertTrue(class_exists('Nette\Diagnostics\Debugger')); 12 | $this->assertAttributeSame('Nette\Diagnostics\Debugger', 'class', $d); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /tests/cases/Rendering/NetteDebug_get_Test.php: -------------------------------------------------------------------------------- 1 | assertSame('editor://open/?file=%file&line=%line', $d->editor); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /tests/cases/Rendering/NetteDebug_isset_Test.php: -------------------------------------------------------------------------------- 1 | assertSame(false, isset($d->foo)); 12 | } 13 | 14 | public function testNull() 15 | { 16 | $d = new HttpPHPUnit\Rendering\NetteDebug; 17 | $tmp = $d->consoleMode; 18 | $this->assertSame(true, isset($d->consoleMode)); 19 | $d->consoleMode = NULL; 20 | $this->assertSame(false, isset($d->consoleMode)); 21 | $d->consoleMode = ''; 22 | $this->assertSame(true, isset($d->consoleMode)); 23 | $d->consoleMode = $tmp; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tests/cases/Rendering/NetteDebug_set_Test.php: -------------------------------------------------------------------------------- 1 | editor; 12 | $d->editor = 'xxx'; 13 | $this->assertSame('xxx', $d->editor); 14 | $d->editor = $tmp; 15 | $this->assertSame('editor://open/?file=%file&line=%line', $d->editor); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /tests/cases/Rendering/NetteDebug_singleton_Test.php: -------------------------------------------------------------------------------- 1 | assertInstanceOf('HttpPHPUnit\Rendering\NetteDebug', $d); 12 | } 13 | 14 | public function testSingleton() 15 | { 16 | $d1 = HttpPHPUnit\Rendering\NetteDebug::get(); 17 | $d2 = HttpPHPUnit\Rendering\NetteDebug::get(); 18 | $this->assertSame($d1, $d2); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /tests/cases/Rendering/ResultPrinter_getTestInfo_Test.php: -------------------------------------------------------------------------------- 1 | setTestDirectory(__DIR__); 13 | $r = new HttpPHPUnit\Rendering\ResultPrinter($configuration, new HttpPHPUnit\Events\Events, new HttpPHPUnit\Config\Link(array(), NULL, NULL)); 14 | $t = new self('DataProvider', array(1,2,'3')); 15 | $r->setAutoFlush(false); 16 | $r->addError($t, new Exception, 0); 17 | $content = file_get_contents($this->readAttribute($r, 'file')); 18 | $this->assertContains('ResultPrinter_getTestInfo :: DataProvider', $content); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /tests/cases/Rendering/ResultPrinter_renderInfo_Test.php: -------------------------------------------------------------------------------- 1 | 3')); 13 | $r->setAutoFlush(false); 14 | $r->addError($t, new Exception, 0); 15 | $content = file_get_contents($this->readAttribute($r, 'file')); 16 | $this->assertContains('
with data set "" (1, 2, \'<b>3</b>\')', $content); 17 | } 18 | 19 | public function testDataProviderOneLine() 20 | { 21 | $configuration = new HttpPHPUnit\Config\Configuration; 22 | $r = new HttpPHPUnit\Rendering\ResultPrinter($configuration, new HttpPHPUnit\Events\Events); 23 | $t = new self('DataProvider', array(1,2,'3')); 24 | $r->setAutoFlush(false); 25 | $r->addIncompleteTest($t, new Exception, 0); 26 | $refl = new ReflectionMethod($r, 'endRun'); 27 | $refl->setAccessible(true); 28 | $refl->invoke($r); 29 | $content = file_get_contents($this->readAttribute($r, 'file')); 30 | $this->assertContains(' with data set "" (1, 2, \'<b>3</b>\')', $content); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /tests/report/.gitignore: -------------------------------------------------------------------------------- 1 | /* 2 | !/.gitignore -------------------------------------------------------------------------------- /tests/run.php: -------------------------------------------------------------------------------- 1 | coverage(__DIR__ . '/../HttpPHPUnit', __DIR__ . '/report', function (PHP_CodeCoverage $coverage) { 12 | $coverage->filter()->removeDirectoryFromWhitelist(__DIR__ . '/../HttpPHPUnit/Nette'); 13 | }); 14 | 15 | $http->run(__DIR__ . '/cases'); 16 | -------------------------------------------------------------------------------- /tests/tmp/.gitignore: -------------------------------------------------------------------------------- 1 | /* 2 | !/.gitignore --------------------------------------------------------------------------------