mirror of
https://github.com/rstudio/shiny.git
synced 2026-04-29 03:00:45 -04:00
771 lines
44 KiB
HTML
771 lines
44 KiB
HTML
<!DOCTYPE html>
|
|
<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Mock Shiny Session — MockShinySession • shiny</title><!-- favicons --><link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png"><link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png"><link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png"><link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png"><link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png"><link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png"><!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous"><script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="../bootstrap-toc.css"><script src="../bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous"><!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet"><script src="../pkgdown.js"></script><meta property="og:title" content="Mock Shiny Session — MockShinySession"><meta property="og:description" content="An R6 class suitable for testing purposes. Simulates, to the
|
|
extent possible, the behavior of the ShinySession class. The session
|
|
parameter provided to Shiny server functions and modules is an instance of
|
|
a ShinySession in normal operation.
|
|
Most kinds of module and server testing do not require this class be
|
|
instantiated manually. See instead testServer().
|
|
In order to support advanced usage, instances of MockShinySession are
|
|
unlocked so that public methods and fields of instances may be
|
|
modified. For example, in order to test authentication workflows, the
|
|
user or groups fields may be overridden. Modified instances of
|
|
MockShinySession may then be passed explicitly as the session argument
|
|
of testServer()."><meta property="og:image" content="/logo.png"><!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
|
|
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
|
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
|
<![endif]--></head><body data-spy="scroll" data-target="#toc">
|
|
|
|
|
|
<div class="container template-reference-topic">
|
|
<header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
|
<div class="container">
|
|
<div class="navbar-header">
|
|
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
|
<span class="sr-only">Toggle navigation</span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
</button>
|
|
<span class="navbar-brand">
|
|
<a class="navbar-link" href="../index.html">shiny</a>
|
|
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="">1.8.0.9000</span>
|
|
</span>
|
|
</div>
|
|
|
|
<div id="navbar" class="navbar-collapse collapse">
|
|
<ul class="nav navbar-nav"><li>
|
|
<a href="../reference/index.html">Reference</a>
|
|
</li>
|
|
<li>
|
|
<a href="../news/index.html">Changelog</a>
|
|
</li>
|
|
</ul><ul class="nav navbar-nav navbar-right"><li>
|
|
<a href="https://github.com/rstudio/shiny/" class="external-link">
|
|
<span class="fab fa-github fa-lg"></span>
|
|
|
|
</a>
|
|
</li>
|
|
</ul></div><!--/.nav-collapse -->
|
|
</div><!--/.container -->
|
|
</div><!--/.navbar -->
|
|
|
|
|
|
|
|
</header><div class="row">
|
|
<div class="col-md-9 contents">
|
|
<div class="page-header">
|
|
<h1>Mock Shiny Session</h1>
|
|
<small class="dont-index">Source: <a href="https://github.com/rstudio/shiny/blob/HEAD/R/mock-session.R" class="external-link"><code>R/mock-session.R</code></a></small>
|
|
<div class="hidden name"><code>MockShinySession.Rd</code></div>
|
|
</div>
|
|
|
|
<div class="ref-description">
|
|
<p>An R6 class suitable for testing purposes. Simulates, to the
|
|
extent possible, the behavior of the <code>ShinySession</code> class. The <code>session</code>
|
|
parameter provided to Shiny server functions and modules is an instance of
|
|
a <code>ShinySession</code> in normal operation.</p>
|
|
<p>Most kinds of module and server testing do not require this class be
|
|
instantiated manually. See instead <code><a href="testServer.html">testServer()</a></code>.</p>
|
|
<p>In order to support advanced usage, instances of <code>MockShinySession</code> are
|
|
<strong>unlocked</strong> so that public methods and fields of instances may be
|
|
modified. For example, in order to test authentication workflows, the
|
|
<code>user</code> or <code>groups</code> fields may be overridden. Modified instances of
|
|
<code>MockShinySession</code> may then be passed explicitly as the <code>session</code> argument
|
|
of <code><a href="testServer.html">testServer()</a></code>.</p>
|
|
</div>
|
|
|
|
|
|
<div id="public-fields">
|
|
<h2>Public fields</h2>
|
|
<p></p><div class="r6-fields"><dl><dt><code>env</code></dt>
|
|
<dd><p>The environment associated with the session.</p></dd>
|
|
|
|
|
|
<dt><code>returned</code></dt>
|
|
<dd><p>The value returned by the module under test.</p></dd>
|
|
|
|
|
|
<dt><code>singletons</code></dt>
|
|
<dd><p>Hardcoded as empty. Needed for rendering HTML (i.e. renderUI).</p></dd>
|
|
|
|
|
|
<dt><code>clientData</code></dt>
|
|
<dd><p>Mock client data that always returns a size for plots.</p></dd>
|
|
|
|
|
|
<dt><code>output</code></dt>
|
|
<dd><p>The shinyoutputs associated with the session.</p></dd>
|
|
|
|
|
|
<dt><code>input</code></dt>
|
|
<dd><p>The reactive inputs associated with the session.</p></dd>
|
|
|
|
|
|
<dt><code>userData</code></dt>
|
|
<dd><p>An environment initialized as empty.</p></dd>
|
|
|
|
|
|
<dt><code>progressStack</code></dt>
|
|
<dd><p>A stack of progress objects.</p></dd>
|
|
|
|
|
|
<dt><code>token</code></dt>
|
|
<dd><p>On a real <code>ShinySession</code>, used to identify this instance in URLs.</p></dd>
|
|
|
|
|
|
<dt><code>cache</code></dt>
|
|
<dd><p>The session cache object.</p></dd>
|
|
|
|
|
|
<dt><code>appcache</code></dt>
|
|
<dd><p>The app cache object.</p></dd>
|
|
|
|
|
|
<dt><code>restoreContext</code></dt>
|
|
<dd><p>Part of bookmarking support in a real
|
|
<code>ShinySession</code> but always <code>NULL</code> for a <code>MockShinySession</code>.</p></dd>
|
|
|
|
|
|
<dt><code>groups</code></dt>
|
|
<dd><p>Character vector of groups associated with an authenticated
|
|
user. Always <code>NULL</code> for a <code>MockShinySesion</code>.</p></dd>
|
|
|
|
|
|
<dt><code>user</code></dt>
|
|
<dd><p>The username of an authenticated user. Always <code>NULL</code> for a
|
|
<code>MockShinySession</code>.</p></dd>
|
|
|
|
|
|
<dt><code>options</code></dt>
|
|
<dd><p>A list containing session-level shinyOptions.</p></dd>
|
|
|
|
|
|
</dl><p></p></div>
|
|
</div>
|
|
<div id="active-bindings">
|
|
<h2>Active bindings</h2>
|
|
<p></p><div class="r6-active-bindings"><dl><dt><code>files</code></dt>
|
|
<dd><p>For internal use only.</p></dd>
|
|
|
|
|
|
<dt><code>downloads</code></dt>
|
|
<dd><p>For internal use only.</p></dd>
|
|
|
|
|
|
<dt><code>closed</code></dt>
|
|
<dd><p>Deprecated in <code>ShinySession</code> and signals an error.</p></dd>
|
|
|
|
|
|
<dt><code>session</code></dt>
|
|
<dd><p>Deprecated in ShinySession and signals an error.</p></dd>
|
|
|
|
|
|
<dt><code>request</code></dt>
|
|
<dd><p>An empty environment where the request should be. The request isn't meaningfully mocked currently.</p></dd>
|
|
|
|
|
|
</dl><p></p></div>
|
|
</div>
|
|
<div id="methods">
|
|
<h2>Methods</h2>
|
|
|
|
<div class="section">
|
|
<h3 id="public-methods">Public methods<a class="anchor" aria-label="anchor" href="#public-methods"></a></h3>
|
|
|
|
<ul><li><p><a href="#method-MockShinySession-new"><code>MockShinySession$new()</code></a></p></li>
|
|
<li><p><a href="#method-MockShinySession-onFlush"><code>MockShinySession$onFlush()</code></a></p></li>
|
|
<li><p><a href="#method-MockShinySession-onFlushed"><code>MockShinySession$onFlushed()</code></a></p></li>
|
|
<li><p><a href="#method-MockShinySession-onEnded"><code>MockShinySession$onEnded()</code></a></p></li>
|
|
<li><p><a href="#method-MockShinySession-isEnded"><code>MockShinySession$isEnded()</code></a></p></li>
|
|
<li><p><a href="#method-MockShinySession-isClosed"><code>MockShinySession$isClosed()</code></a></p></li>
|
|
<li><p><a href="#method-MockShinySession-close"><code>MockShinySession$close()</code></a></p></li>
|
|
<li><p><a href="#method-MockShinySession-cycleStartAction"><code>MockShinySession$cycleStartAction()</code></a></p></li>
|
|
<li><p><a href="#method-MockShinySession-fileUrl"><code>MockShinySession$fileUrl()</code></a></p></li>
|
|
<li><p><a href="#method-MockShinySession-setInputs"><code>MockShinySession$setInputs()</code></a></p></li>
|
|
<li><p><a href="#method-MockShinySession-.scheduleTask"><code>MockShinySession$.scheduleTask()</code></a></p></li>
|
|
<li><p><a href="#method-MockShinySession-elapse"><code>MockShinySession$elapse()</code></a></p></li>
|
|
<li><p><a href="#method-MockShinySession-.now"><code>MockShinySession$.now()</code></a></p></li>
|
|
<li><p><a href="#method-MockShinySession-defineOutput"><code>MockShinySession$defineOutput()</code></a></p></li>
|
|
<li><p><a href="#method-MockShinySession-getOutput"><code>MockShinySession$getOutput()</code></a></p></li>
|
|
<li><p><a href="#method-MockShinySession-ns"><code>MockShinySession$ns()</code></a></p></li>
|
|
<li><p><a href="#method-MockShinySession-flushReact"><code>MockShinySession$flushReact()</code></a></p></li>
|
|
<li><p><a href="#method-MockShinySession-makeScope"><code>MockShinySession$makeScope()</code></a></p></li>
|
|
<li><p><a href="#method-MockShinySession-setEnv"><code>MockShinySession$setEnv()</code></a></p></li>
|
|
<li><p><a href="#method-MockShinySession-setReturned"><code>MockShinySession$setReturned()</code></a></p></li>
|
|
<li><p><a href="#method-MockShinySession-getReturned"><code>MockShinySession$getReturned()</code></a></p></li>
|
|
<li><p><a href="#method-MockShinySession-genId"><code>MockShinySession$genId()</code></a></p></li>
|
|
<li><p><a href="#method-MockShinySession-rootScope"><code>MockShinySession$rootScope()</code></a></p></li>
|
|
<li><p><a href="#method-MockShinySession-onUnhandledError"><code>MockShinySession$onUnhandledError()</code></a></p></li>
|
|
<li><p><a href="#method-MockShinySession-unhandledError"><code>MockShinySession$unhandledError()</code></a></p></li>
|
|
<li><p><a href="#method-MockShinySession-freezeValue"><code>MockShinySession$freezeValue()</code></a></p></li>
|
|
<li><p><a href="#method-MockShinySession-onSessionEnded"><code>MockShinySession$onSessionEnded()</code></a></p></li>
|
|
<li><p><a href="#method-MockShinySession-registerDownload"><code>MockShinySession$registerDownload()</code></a></p></li>
|
|
<li><p><a href="#method-MockShinySession-getCurrentOutputInfo"><code>MockShinySession$getCurrentOutputInfo()</code></a></p></li>
|
|
<li><p><a href="#method-MockShinySession-clone"><code>MockShinySession$clone()</code></a></p></li>
|
|
</ul></div><p></p><hr><a id="method-MockShinySession-new"></a><div class="section">
|
|
<h3 id="method-new-">Method <code><a href="https://rdrr.io/r/methods/new.html" class="external-link">new()</a></code><a class="anchor" aria-label="anchor" href="#method-new-"></a></h3>
|
|
<p>Create a new MockShinySession.</p><div class="section">
|
|
<h4 id="usage">Usage<a class="anchor" aria-label="anchor" href="#usage"></a></h4>
|
|
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va"><a href="../reference/MockShinySession.html">MockShinySession</a></span><span class="op">$</span><span class="fu">new</span><span class="op">(</span><span class="op">)</span></span></code></pre></div><p></p></div>
|
|
</div>
|
|
|
|
|
|
</div><p></p><hr><a id="method-MockShinySession-onFlush"></a><div class="section">
|
|
<h3 id="method-onflush-">Method <code><a href="onFlush.html">onFlush()</a></code><a class="anchor" aria-label="anchor" href="#method-onflush-"></a></h3>
|
|
<p>Define a callback to be invoked before a reactive flush</p><div class="section">
|
|
<h4 id="usage-1">Usage<a class="anchor" aria-label="anchor" href="#usage-1"></a></h4>
|
|
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">MockShinySession</span><span class="op">$</span><span class="fu">onFlush</span><span class="op">(</span><span class="va">fun</span>, once <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></code></pre></div><p></p></div>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<h4 id="arguments">Arguments<a class="anchor" aria-label="anchor" href="#arguments"></a></h4>
|
|
<p></p><div class="arguments"><dl><dt><code>fun</code></dt>
|
|
<dd><p>The function to invoke</p></dd>
|
|
|
|
|
|
<dt><code>once</code></dt>
|
|
<dd><p>If <code>TRUE</code>, will only run once. Otherwise, will run every time reactives are flushed.</p></dd>
|
|
|
|
|
|
</dl><p></p></div>
|
|
</div>
|
|
|
|
</div><p></p><hr><a id="method-MockShinySession-onFlushed"></a><div class="section">
|
|
<h3 id="method-onflushed-">Method <code><a href="onFlush.html">onFlushed()</a></code><a class="anchor" aria-label="anchor" href="#method-onflushed-"></a></h3>
|
|
<p>Define a callback to be invoked after a reactive flush</p><div class="section">
|
|
<h4 id="usage-2">Usage<a class="anchor" aria-label="anchor" href="#usage-2"></a></h4>
|
|
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">MockShinySession</span><span class="op">$</span><span class="fu">onFlushed</span><span class="op">(</span><span class="va">fun</span>, once <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></code></pre></div><p></p></div>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<h4 id="arguments-1">Arguments<a class="anchor" aria-label="anchor" href="#arguments-1"></a></h4>
|
|
<p></p><div class="arguments"><dl><dt><code>fun</code></dt>
|
|
<dd><p>The function to invoke</p></dd>
|
|
|
|
|
|
<dt><code>once</code></dt>
|
|
<dd><p>If <code>TRUE</code>, will only run once. Otherwise, will run every time reactives are flushed.</p></dd>
|
|
|
|
|
|
</dl><p></p></div>
|
|
</div>
|
|
|
|
</div><p></p><hr><a id="method-MockShinySession-onEnded"></a><div class="section">
|
|
<h3 id="method-onended-">Method <code>onEnded()</code><a class="anchor" aria-label="anchor" href="#method-onended-"></a></h3>
|
|
<p>Define a callback to be invoked when the session ends</p><div class="section">
|
|
<h4 id="usage-3">Usage<a class="anchor" aria-label="anchor" href="#usage-3"></a></h4>
|
|
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">MockShinySession</span><span class="op">$</span><span class="fu">onEnded</span><span class="op">(</span><span class="va">sessionEndedCallback</span><span class="op">)</span></span></code></pre></div><p></p></div>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<h4 id="arguments-2">Arguments<a class="anchor" aria-label="anchor" href="#arguments-2"></a></h4>
|
|
<p></p><div class="arguments"><dl><dt><code>sessionEndedCallback</code></dt>
|
|
<dd><p>The callback to invoke when the session has ended.</p></dd>
|
|
|
|
|
|
</dl><p></p></div>
|
|
</div>
|
|
|
|
</div><p></p><hr><a id="method-MockShinySession-isEnded"></a><div class="section">
|
|
<h3 id="method-isended-">Method <code>isEnded()</code><a class="anchor" aria-label="anchor" href="#method-isended-"></a></h3>
|
|
<p>Returns <code>FALSE</code> if the session has not yet been closed</p><div class="section">
|
|
<h4 id="usage-4">Usage<a class="anchor" aria-label="anchor" href="#usage-4"></a></h4>
|
|
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">MockShinySession</span><span class="op">$</span><span class="fu">isEnded</span><span class="op">(</span><span class="op">)</span></span></code></pre></div><p></p></div>
|
|
</div>
|
|
|
|
|
|
</div><p></p><hr><a id="method-MockShinySession-isClosed"></a><div class="section">
|
|
<h3 id="method-isclosed-">Method <code>isClosed()</code><a class="anchor" aria-label="anchor" href="#method-isclosed-"></a></h3>
|
|
<p>Returns <code>FALSE</code> if the session has not yet been closed</p><div class="section">
|
|
<h4 id="usage-5">Usage<a class="anchor" aria-label="anchor" href="#usage-5"></a></h4>
|
|
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">MockShinySession</span><span class="op">$</span><span class="fu">isClosed</span><span class="op">(</span><span class="op">)</span></span></code></pre></div><p></p></div>
|
|
</div>
|
|
|
|
|
|
</div><p></p><hr><a id="method-MockShinySession-close"></a><div class="section">
|
|
<h3 id="method-close-">Method <code><a href="https://rdrr.io/r/base/connections.html" class="external-link">close()</a></code><a class="anchor" aria-label="anchor" href="#method-close-"></a></h3>
|
|
<p>Closes the session</p><div class="section">
|
|
<h4 id="usage-6">Usage<a class="anchor" aria-label="anchor" href="#usage-6"></a></h4>
|
|
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">MockShinySession</span><span class="op">$</span><span class="fu">close</span><span class="op">(</span><span class="op">)</span></span></code></pre></div><p></p></div>
|
|
</div>
|
|
|
|
|
|
</div><p></p><hr><a id="method-MockShinySession-cycleStartAction"></a><div class="section">
|
|
<h3 id="method-cyclestartaction-">Method <code>cycleStartAction()</code><a class="anchor" aria-label="anchor" href="#method-cyclestartaction-"></a></h3>
|
|
<p>Unsophisticated mock implementation that merely invokes</p><div class="section">
|
|
<h4 id="usage-7">Usage<a class="anchor" aria-label="anchor" href="#usage-7"></a></h4>
|
|
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">MockShinySession</span><span class="op">$</span><span class="fu">cycleStartAction</span><span class="op">(</span><span class="va">callback</span><span class="op">)</span></span></code></pre></div><p></p></div>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<h4 id="arguments-3">Arguments<a class="anchor" aria-label="anchor" href="#arguments-3"></a></h4>
|
|
<p></p><div class="arguments"><dl><dt><code>callback</code></dt>
|
|
<dd><p>The callback to be invoked.</p></dd>
|
|
|
|
|
|
</dl><p></p></div>
|
|
</div>
|
|
|
|
</div><p></p><hr><a id="method-MockShinySession-fileUrl"></a><div class="section">
|
|
<h3 id="method-fileurl-">Method <code>fileUrl()</code><a class="anchor" aria-label="anchor" href="#method-fileurl-"></a></h3>
|
|
<p>Base64-encode the given file. Needed for image rendering.</p><div class="section">
|
|
<h4 id="usage-8">Usage<a class="anchor" aria-label="anchor" href="#usage-8"></a></h4>
|
|
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">MockShinySession</span><span class="op">$</span><span class="fu">fileUrl</span><span class="op">(</span><span class="va">name</span>, <span class="va">file</span>, contentType <span class="op">=</span> <span class="st">"application/octet-stream"</span><span class="op">)</span></span></code></pre></div><p></p></div>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<h4 id="arguments-4">Arguments<a class="anchor" aria-label="anchor" href="#arguments-4"></a></h4>
|
|
<p></p><div class="arguments"><dl><dt><code>name</code></dt>
|
|
<dd><p>Not used</p></dd>
|
|
|
|
|
|
<dt><code>file</code></dt>
|
|
<dd><p>The file to be encoded</p></dd>
|
|
|
|
|
|
<dt><code>contentType</code></dt>
|
|
<dd><p>The content type of the base64-encoded string</p></dd>
|
|
|
|
|
|
</dl><p></p></div>
|
|
</div>
|
|
|
|
</div><p></p><hr><a id="method-MockShinySession-setInputs"></a><div class="section">
|
|
<h3 id="method-setinputs-">Method <code>setInputs()</code><a class="anchor" aria-label="anchor" href="#method-setinputs-"></a></h3>
|
|
<p>Sets reactive values associated with the <code>session$inputs</code>
|
|
object and flushes the reactives.</p><div class="section">
|
|
<h4 id="usage-9">Usage<a class="anchor" aria-label="anchor" href="#usage-9"></a></h4>
|
|
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">MockShinySession</span><span class="op">$</span><span class="fu">setInputs</span><span class="op">(</span><span class="va">...</span><span class="op">)</span></span></code></pre></div><p></p></div>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<h4 id="arguments-5">Arguments<a class="anchor" aria-label="anchor" href="#arguments-5"></a></h4>
|
|
<p></p><div class="arguments"><dl><dt><code>...</code></dt>
|
|
<dd><p>The inputs to set. These arguments are processed with
|
|
<code><a href="https://rlang.r-lib.org/reference/list2.html" class="external-link">rlang::list2()</a></code> and so are <em><a href="https://rlang.r-lib.org/reference/dyn-dots.html" class="external-link">dynamic</a></em>. Input names
|
|
may not be duplicated.</p></dd>
|
|
|
|
|
|
</dl><p></p></div>
|
|
</div>
|
|
<div class="section">
|
|
<h4 id="examples">Examples<a class="anchor" aria-label="anchor" href="#examples"></a></h4>
|
|
<p></p><div class="r example copy"><div class="sourceCode"><pre><code>\dontrun{
|
|
session$setInputs(x=1, y=2)
|
|
}
|
|
</code></pre></div><p></p></div>
|
|
</div>
|
|
|
|
|
|
</div><p></p><hr><a id="method-MockShinySession-.scheduleTask"></a><div class="section">
|
|
<h3 id="method-scheduletask-">Method <code>.scheduleTask()</code><a class="anchor" aria-label="anchor" href="#method-scheduletask-"></a></h3>
|
|
<p>An internal method which shouldn't be used by others.
|
|
Schedules <code>callback</code> for execution after some number of <code>millis</code>
|
|
milliseconds.</p><div class="section">
|
|
<h4 id="usage-10">Usage<a class="anchor" aria-label="anchor" href="#usage-10"></a></h4>
|
|
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">MockShinySession</span><span class="op">$</span><span class="fu">.scheduleTask</span><span class="op">(</span><span class="va">millis</span>, <span class="va">callback</span><span class="op">)</span></span></code></pre></div><p></p></div>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<h4 id="arguments-6">Arguments<a class="anchor" aria-label="anchor" href="#arguments-6"></a></h4>
|
|
<p></p><div class="arguments"><dl><dt><code>millis</code></dt>
|
|
<dd><p>The number of milliseconds on which to schedule a callback</p></dd>
|
|
|
|
|
|
<dt><code>callback</code></dt>
|
|
<dd><p>The function to schedule.</p></dd>
|
|
|
|
|
|
</dl><p></p></div>
|
|
</div>
|
|
|
|
</div><p></p><hr><a id="method-MockShinySession-elapse"></a><div class="section">
|
|
<h3 id="method-elapse-">Method <code>elapse()</code><a class="anchor" aria-label="anchor" href="#method-elapse-"></a></h3>
|
|
<p>Simulate the passing of time by the given number of milliseconds.</p><div class="section">
|
|
<h4 id="usage-11">Usage<a class="anchor" aria-label="anchor" href="#usage-11"></a></h4>
|
|
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">MockShinySession</span><span class="op">$</span><span class="fu">elapse</span><span class="op">(</span><span class="va">millis</span><span class="op">)</span></span></code></pre></div><p></p></div>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<h4 id="arguments-7">Arguments<a class="anchor" aria-label="anchor" href="#arguments-7"></a></h4>
|
|
<p></p><div class="arguments"><dl><dt><code>millis</code></dt>
|
|
<dd><p>The number of milliseconds to advance time.</p></dd>
|
|
|
|
|
|
</dl><p></p></div>
|
|
</div>
|
|
|
|
</div><p></p><hr><a id="method-MockShinySession-.now"></a><div class="section">
|
|
<h3 id="method-now-">Method <code>.now()</code><a class="anchor" aria-label="anchor" href="#method-now-"></a></h3>
|
|
<p>An internal method which shouldn't be used by others.</p><div class="section">
|
|
<h4 id="usage-12">Usage<a class="anchor" aria-label="anchor" href="#usage-12"></a></h4>
|
|
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">MockShinySession</span><span class="op">$</span><span class="fu">.now</span><span class="op">(</span><span class="op">)</span></span></code></pre></div><p></p></div>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<h4 id="returns">Returns<a class="anchor" aria-label="anchor" href="#returns"></a></h4>
|
|
<p>Elapsed time in milliseconds.</p>
|
|
</div>
|
|
|
|
</div><p></p><hr><a id="method-MockShinySession-defineOutput"></a><div class="section">
|
|
<h3 id="method-defineoutput-">Method <code>defineOutput()</code><a class="anchor" aria-label="anchor" href="#method-defineoutput-"></a></h3>
|
|
<p>An internal method which shouldn't be used by others.
|
|
Defines an output in a way that sets private$currentOutputName
|
|
appropriately.</p><div class="section">
|
|
<h4 id="usage-13">Usage<a class="anchor" aria-label="anchor" href="#usage-13"></a></h4>
|
|
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">MockShinySession</span><span class="op">$</span><span class="fu">defineOutput</span><span class="op">(</span><span class="va">name</span>, <span class="va">func</span>, <span class="va">label</span><span class="op">)</span></span></code></pre></div><p></p></div>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<h4 id="arguments-8">Arguments<a class="anchor" aria-label="anchor" href="#arguments-8"></a></h4>
|
|
<p></p><div class="arguments"><dl><dt><code>name</code></dt>
|
|
<dd><p>The name of the output.</p></dd>
|
|
|
|
|
|
<dt><code>func</code></dt>
|
|
<dd><p>The render definition.</p></dd>
|
|
|
|
|
|
<dt><code>label</code></dt>
|
|
<dd><p>Not used.</p></dd>
|
|
|
|
|
|
</dl><p></p></div>
|
|
</div>
|
|
|
|
</div><p></p><hr><a id="method-MockShinySession-getOutput"></a><div class="section">
|
|
<h3 id="method-getoutput-">Method <code>getOutput()</code><a class="anchor" aria-label="anchor" href="#method-getoutput-"></a></h3>
|
|
<p>An internal method which shouldn't be used by others. Forces
|
|
evaluation of any reactive dependencies of the output function.</p><div class="section">
|
|
<h4 id="usage-14">Usage<a class="anchor" aria-label="anchor" href="#usage-14"></a></h4>
|
|
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">MockShinySession</span><span class="op">$</span><span class="fu">getOutput</span><span class="op">(</span><span class="va">name</span><span class="op">)</span></span></code></pre></div><p></p></div>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<h4 id="arguments-9">Arguments<a class="anchor" aria-label="anchor" href="#arguments-9"></a></h4>
|
|
<p></p><div class="arguments"><dl><dt><code>name</code></dt>
|
|
<dd><p>The name of the output.</p></dd>
|
|
|
|
|
|
</dl><p></p></div>
|
|
</div>
|
|
<div class="section">
|
|
<h4 id="returns-1">Returns<a class="anchor" aria-label="anchor" href="#returns-1"></a></h4>
|
|
<p>The return value of the function responsible for rendering the
|
|
output.</p>
|
|
</div>
|
|
|
|
</div><p></p><hr><a id="method-MockShinySession-ns"></a><div class="section">
|
|
<h3 id="method-ns-">Method <code>ns()</code><a class="anchor" aria-label="anchor" href="#method-ns-"></a></h3>
|
|
<p>Returns the given id prefixed by this namespace's id.</p><div class="section">
|
|
<h4 id="usage-15">Usage<a class="anchor" aria-label="anchor" href="#usage-15"></a></h4>
|
|
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">MockShinySession</span><span class="op">$</span><span class="fu">ns</span><span class="op">(</span><span class="va">id</span><span class="op">)</span></span></code></pre></div><p></p></div>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<h4 id="arguments-10">Arguments<a class="anchor" aria-label="anchor" href="#arguments-10"></a></h4>
|
|
<p></p><div class="arguments"><dl><dt><code>id</code></dt>
|
|
<dd><p>The id to prefix with a namespace id.</p></dd>
|
|
|
|
|
|
</dl><p></p></div>
|
|
</div>
|
|
<div class="section">
|
|
<h4 id="returns-2">Returns<a class="anchor" aria-label="anchor" href="#returns-2"></a></h4>
|
|
<p>The id with a namespace prefix.</p>
|
|
</div>
|
|
|
|
</div><p></p><hr><a id="method-MockShinySession-flushReact"></a><div class="section">
|
|
<h3 id="method-flushreact-">Method <code>flushReact()</code><a class="anchor" aria-label="anchor" href="#method-flushreact-"></a></h3>
|
|
<p>Trigger a reactive flush right now.</p><div class="section">
|
|
<h4 id="usage-16">Usage<a class="anchor" aria-label="anchor" href="#usage-16"></a></h4>
|
|
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">MockShinySession</span><span class="op">$</span><span class="fu">flushReact</span><span class="op">(</span><span class="op">)</span></span></code></pre></div><p></p></div>
|
|
</div>
|
|
|
|
|
|
</div><p></p><hr><a id="method-MockShinySession-makeScope"></a><div class="section">
|
|
<h3 id="method-makescope-">Method <code>makeScope()</code><a class="anchor" aria-label="anchor" href="#method-makescope-"></a></h3>
|
|
<p>Create and return a namespace-specific session proxy.</p><div class="section">
|
|
<h4 id="usage-17">Usage<a class="anchor" aria-label="anchor" href="#usage-17"></a></h4>
|
|
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">MockShinySession</span><span class="op">$</span><span class="fu">makeScope</span><span class="op">(</span><span class="va">namespace</span><span class="op">)</span></span></code></pre></div><p></p></div>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<h4 id="arguments-11">Arguments<a class="anchor" aria-label="anchor" href="#arguments-11"></a></h4>
|
|
<p></p><div class="arguments"><dl><dt><code>namespace</code></dt>
|
|
<dd><p>Character vector indicating a namespace.</p></dd>
|
|
|
|
|
|
</dl><p></p></div>
|
|
</div>
|
|
<div class="section">
|
|
<h4 id="returns-3">Returns<a class="anchor" aria-label="anchor" href="#returns-3"></a></h4>
|
|
<p>A new session proxy.</p>
|
|
</div>
|
|
|
|
</div><p></p><hr><a id="method-MockShinySession-setEnv"></a><div class="section">
|
|
<h3 id="method-setenv-">Method <code>setEnv()</code><a class="anchor" aria-label="anchor" href="#method-setenv-"></a></h3>
|
|
<p>Set the environment associated with a testServer() call, but
|
|
only if it has not previously been set. This ensures that only the
|
|
environment of the outermost module under test is the one retained. In
|
|
other words, the first assignment wins.</p><div class="section">
|
|
<h4 id="usage-18">Usage<a class="anchor" aria-label="anchor" href="#usage-18"></a></h4>
|
|
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">MockShinySession</span><span class="op">$</span><span class="fu">setEnv</span><span class="op">(</span><span class="va">env</span><span class="op">)</span></span></code></pre></div><p></p></div>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<h4 id="arguments-12">Arguments<a class="anchor" aria-label="anchor" href="#arguments-12"></a></h4>
|
|
<p></p><div class="arguments"><dl><dt><code>env</code></dt>
|
|
<dd><p>The environment to retain.</p></dd>
|
|
|
|
|
|
</dl><p></p></div>
|
|
</div>
|
|
<div class="section">
|
|
<h4 id="returns-4">Returns<a class="anchor" aria-label="anchor" href="#returns-4"></a></h4>
|
|
<p>The provided <code>env</code>.</p>
|
|
</div>
|
|
|
|
</div><p></p><hr><a id="method-MockShinySession-setReturned"></a><div class="section">
|
|
<h3 id="method-setreturned-">Method <code>setReturned()</code><a class="anchor" aria-label="anchor" href="#method-setreturned-"></a></h3>
|
|
<p>Set the value returned by the module call and proactively
|
|
flush. Note that this method may be called multiple times if modules
|
|
are nested. The last assignment, corresponding to an invocation of
|
|
setReturned() in the outermost module, wins.</p><div class="section">
|
|
<h4 id="usage-19">Usage<a class="anchor" aria-label="anchor" href="#usage-19"></a></h4>
|
|
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">MockShinySession</span><span class="op">$</span><span class="fu">setReturned</span><span class="op">(</span><span class="va">value</span><span class="op">)</span></span></code></pre></div><p></p></div>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<h4 id="arguments-13">Arguments<a class="anchor" aria-label="anchor" href="#arguments-13"></a></h4>
|
|
<p></p><div class="arguments"><dl><dt><code>value</code></dt>
|
|
<dd><p>The value returned from the module</p></dd>
|
|
|
|
|
|
</dl><p></p></div>
|
|
</div>
|
|
<div class="section">
|
|
<h4 id="returns-5">Returns<a class="anchor" aria-label="anchor" href="#returns-5"></a></h4>
|
|
<p>The provided <code>value</code>.</p>
|
|
</div>
|
|
|
|
</div><p></p><hr><a id="method-MockShinySession-getReturned"></a><div class="section">
|
|
<h3 id="method-getreturned-">Method <code>getReturned()</code><a class="anchor" aria-label="anchor" href="#method-getreturned-"></a></h3>
|
|
<p>Get the value returned by the module call.</p><div class="section">
|
|
<h4 id="usage-20">Usage<a class="anchor" aria-label="anchor" href="#usage-20"></a></h4>
|
|
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">MockShinySession</span><span class="op">$</span><span class="fu">getReturned</span><span class="op">(</span><span class="op">)</span></span></code></pre></div><p></p></div>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<h4 id="returns-6">Returns<a class="anchor" aria-label="anchor" href="#returns-6"></a></h4>
|
|
<p>The value returned by the module call</p>
|
|
</div>
|
|
|
|
</div><p></p><hr><a id="method-MockShinySession-genId"></a><div class="section">
|
|
<h3 id="method-genid-">Method <code>genId()</code><a class="anchor" aria-label="anchor" href="#method-genid-"></a></h3>
|
|
<p>Generate a distinct character identifier for use as a proxy
|
|
namespace.</p><div class="section">
|
|
<h4 id="usage-21">Usage<a class="anchor" aria-label="anchor" href="#usage-21"></a></h4>
|
|
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">MockShinySession</span><span class="op">$</span><span class="fu">genId</span><span class="op">(</span><span class="op">)</span></span></code></pre></div><p></p></div>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<h4 id="returns-7">Returns<a class="anchor" aria-label="anchor" href="#returns-7"></a></h4>
|
|
<p>A character identifier unique to the current session.</p>
|
|
</div>
|
|
|
|
</div><p></p><hr><a id="method-MockShinySession-rootScope"></a><div class="section">
|
|
<h3 id="method-rootscope-">Method <code>rootScope()</code><a class="anchor" aria-label="anchor" href="#method-rootscope-"></a></h3>
|
|
<p>Provides a way to access the root <code>MockShinySession</code> from
|
|
any descendant proxy.</p><div class="section">
|
|
<h4 id="usage-22">Usage<a class="anchor" aria-label="anchor" href="#usage-22"></a></h4>
|
|
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">MockShinySession</span><span class="op">$</span><span class="fu">rootScope</span><span class="op">(</span><span class="op">)</span></span></code></pre></div><p></p></div>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<h4 id="returns-8">Returns<a class="anchor" aria-label="anchor" href="#returns-8"></a></h4>
|
|
<p>The root <code>MockShinySession</code>.</p>
|
|
</div>
|
|
|
|
</div><p></p><hr><a id="method-MockShinySession-onUnhandledError"></a><div class="section">
|
|
<h3 id="method-onunhandlederror-">Method <code><a href="onFlush.html">onUnhandledError()</a></code><a class="anchor" aria-label="anchor" href="#method-onunhandlederror-"></a></h3>
|
|
<p>Add an unhandled error callback.</p><div class="section">
|
|
<h4 id="usage-23">Usage<a class="anchor" aria-label="anchor" href="#usage-23"></a></h4>
|
|
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">MockShinySession</span><span class="op">$</span><span class="fu">onUnhandledError</span><span class="op">(</span><span class="va">callback</span><span class="op">)</span></span></code></pre></div><p></p></div>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<h4 id="arguments-14">Arguments<a class="anchor" aria-label="anchor" href="#arguments-14"></a></h4>
|
|
<p></p><div class="arguments"><dl><dt><code>callback</code></dt>
|
|
<dd><p>The callback to add, which should accept an error object
|
|
as its first argument.</p></dd>
|
|
|
|
|
|
</dl><p></p></div>
|
|
</div>
|
|
<div class="section">
|
|
<h4 id="returns-9">Returns<a class="anchor" aria-label="anchor" href="#returns-9"></a></h4>
|
|
<p>A deregistration function.</p>
|
|
</div>
|
|
|
|
</div><p></p><hr><a id="method-MockShinySession-unhandledError"></a><div class="section">
|
|
<h3 id="method-unhandlederror-">Method <code>unhandledError()</code><a class="anchor" aria-label="anchor" href="#method-unhandlederror-"></a></h3>
|
|
<p>Called by observers when a reactive expression errors.</p><div class="section">
|
|
<h4 id="usage-24">Usage<a class="anchor" aria-label="anchor" href="#usage-24"></a></h4>
|
|
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">MockShinySession</span><span class="op">$</span><span class="fu">unhandledError</span><span class="op">(</span><span class="va">e</span>, close <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></code></pre></div><p></p></div>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<h4 id="arguments-15">Arguments<a class="anchor" aria-label="anchor" href="#arguments-15"></a></h4>
|
|
<p></p><div class="arguments"><dl><dt><code>e</code></dt>
|
|
<dd><p>An error object.</p></dd>
|
|
|
|
|
|
</dl><p></p></div>
|
|
</div>
|
|
|
|
</div><p></p><hr><a id="method-MockShinySession-freezeValue"></a><div class="section">
|
|
<h3 id="method-freezevalue-">Method <code>freezeValue()</code><a class="anchor" aria-label="anchor" href="#method-freezevalue-"></a></h3>
|
|
<p>Freeze a value until the flush cycle completes.</p><div class="section">
|
|
<h4 id="usage-25">Usage<a class="anchor" aria-label="anchor" href="#usage-25"></a></h4>
|
|
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">MockShinySession</span><span class="op">$</span><span class="fu">freezeValue</span><span class="op">(</span><span class="va">x</span>, <span class="va">name</span><span class="op">)</span></span></code></pre></div><p></p></div>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<h4 id="arguments-16">Arguments<a class="anchor" aria-label="anchor" href="#arguments-16"></a></h4>
|
|
<p></p><div class="arguments"><dl><dt><code>x</code></dt>
|
|
<dd><p>A <code>ReactiveValues</code> object.</p></dd>
|
|
|
|
|
|
<dt><code>name</code></dt>
|
|
<dd><p>The name of a reactive value within <code>x</code>.</p></dd>
|
|
|
|
|
|
</dl><p></p></div>
|
|
</div>
|
|
|
|
</div><p></p><hr><a id="method-MockShinySession-onSessionEnded"></a><div class="section">
|
|
<h3 id="method-onsessionended-">Method <code><a href="onFlush.html">onSessionEnded()</a></code><a class="anchor" aria-label="anchor" href="#method-onsessionended-"></a></h3>
|
|
<p>Registers the given callback to be invoked when the session
|
|
is closed (i.e. the connection to the client has been severed). The
|
|
return value is a function which unregisters the callback. If multiple
|
|
callbacks are registered, the order in which they are invoked is not
|
|
guaranteed.</p><div class="section">
|
|
<h4 id="usage-26">Usage<a class="anchor" aria-label="anchor" href="#usage-26"></a></h4>
|
|
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">MockShinySession</span><span class="op">$</span><span class="fu">onSessionEnded</span><span class="op">(</span><span class="va">sessionEndedCallback</span><span class="op">)</span></span></code></pre></div><p></p></div>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<h4 id="arguments-17">Arguments<a class="anchor" aria-label="anchor" href="#arguments-17"></a></h4>
|
|
<p></p><div class="arguments"><dl><dt><code>sessionEndedCallback</code></dt>
|
|
<dd><p>Function to call when the session ends.</p></dd>
|
|
|
|
|
|
</dl><p></p></div>
|
|
</div>
|
|
|
|
</div><p></p><hr><a id="method-MockShinySession-registerDownload"></a><div class="section">
|
|
<h3 id="method-registerdownload-">Method <code>registerDownload()</code><a class="anchor" aria-label="anchor" href="#method-registerdownload-"></a></h3>
|
|
<p>Associated a downloadable file with the session.</p><div class="section">
|
|
<h4 id="usage-27">Usage<a class="anchor" aria-label="anchor" href="#usage-27"></a></h4>
|
|
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">MockShinySession</span><span class="op">$</span><span class="fu">registerDownload</span><span class="op">(</span><span class="va">name</span>, <span class="va">filename</span>, <span class="va">contentType</span>, <span class="va">content</span><span class="op">)</span></span></code></pre></div><p></p></div>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<h4 id="arguments-18">Arguments<a class="anchor" aria-label="anchor" href="#arguments-18"></a></h4>
|
|
<p></p><div class="arguments"><dl><dt><code>name</code></dt>
|
|
<dd><p>The un-namespaced output name to associate with the
|
|
downloadable file.</p></dd>
|
|
|
|
|
|
<dt><code>filename</code></dt>
|
|
<dd><p>A string or function designating the name of the file.</p></dd>
|
|
|
|
|
|
<dt><code>contentType</code></dt>
|
|
<dd><p>A string of the content type of the file. Not used by
|
|
<code>MockShinySession</code>.</p></dd>
|
|
|
|
|
|
<dt><code>content</code></dt>
|
|
<dd><p>A function that takes a single argument file that is a
|
|
file path (string) of a nonexistent temp file, and writes the content
|
|
to that file path. (Reactive values and functions may be used from this
|
|
function.)</p></dd>
|
|
|
|
|
|
</dl><p></p></div>
|
|
</div>
|
|
|
|
</div><p></p><hr><a id="method-MockShinySession-getCurrentOutputInfo"></a><div class="section">
|
|
<h3 id="method-getcurrentoutputinfo-">Method <code><a href="getCurrentOutputInfo.html">getCurrentOutputInfo()</a></code><a class="anchor" aria-label="anchor" href="#method-getcurrentoutputinfo-"></a></h3>
|
|
<p>Get information about the output that is currently being
|
|
executed.</p><div class="section">
|
|
<h4 id="usage-28">Usage<a class="anchor" aria-label="anchor" href="#usage-28"></a></h4>
|
|
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">MockShinySession</span><span class="op">$</span><span class="fu">getCurrentOutputInfo</span><span class="op">(</span><span class="op">)</span></span></code></pre></div><p></p></div>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<h4 id="returns-10">Returns<a class="anchor" aria-label="anchor" href="#returns-10"></a></h4>
|
|
<p>A list with with the <code>name</code> of the output. If no output is
|
|
currently being executed, this will return <code>NULL</code>.
|
|
output, or <code>NULL</code> if no output is currently executing.</p>
|
|
</div>
|
|
|
|
</div><p></p><hr><a id="method-MockShinySession-clone"></a><div class="section">
|
|
<h3 id="method-clone-">Method <code>clone()</code><a class="anchor" aria-label="anchor" href="#method-clone-"></a></h3>
|
|
<p>The objects of this class are cloneable with this method.</p><div class="section">
|
|
<h4 id="usage-29">Usage<a class="anchor" aria-label="anchor" href="#usage-29"></a></h4>
|
|
<p></p><div class="r"><div class="sourceCode"><pre><code><span><span class="va">MockShinySession</span><span class="op">$</span><span class="fu">clone</span><span class="op">(</span>deep <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span></span></code></pre></div><p></p></div>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<h4 id="arguments-19">Arguments<a class="anchor" aria-label="anchor" href="#arguments-19"></a></h4>
|
|
<p></p><div class="arguments"><dl><dt><code>deep</code></dt>
|
|
<dd><p>Whether to make a deep clone.</p></dd>
|
|
|
|
|
|
</dl><p></p></div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div id="ref-examples">
|
|
<h2>Examples</h2>
|
|
<div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span></span></span>
|
|
<span class="r-in"><span><span class="co">## ------------------------------------------------</span></span></span>
|
|
<span class="r-in"><span><span class="co">## Method `MockShinySession$setInputs`</span></span></span>
|
|
<span class="r-in"><span><span class="co">## ------------------------------------------------</span></span></span>
|
|
<span class="r-in"><span></span></span>
|
|
<span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="cn">FALSE</span><span class="op">)</span> <span class="op">{</span></span></span>
|
|
<span class="r-in"><span><span class="va">session</span><span class="op">$</span><span class="fu">setInputs</span><span class="op">(</span>x<span class="op">=</span><span class="fl">1</span>, y<span class="op">=</span><span class="fl">2</span><span class="op">)</span></span></span>
|
|
<span class="r-in"><span><span class="op">}</span></span></span>
|
|
</code></pre></div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
|
|
<nav id="toc" data-toggle="toc" class="sticky-top"><h2 data-toc-skip>Contents</h2>
|
|
</nav></div>
|
|
</div>
|
|
|
|
|
|
<footer><div class="copyright">
|
|
<p></p><p>Developed by Winston Chang, Joe Cheng, JJ Allaire, Carson Sievert, Barret Schloerke, Yihui Xie, Jeff Allen, Jonathan McPherson, Alan Dipert, Barbara Borges, Posit Software, PBC.</p>
|
|
</div>
|
|
|
|
<div class="pkgdown">
|
|
<p></p><p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.7.</p>
|
|
</div>
|
|
|
|
</footer></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</body></html>
|
|
|