> For the complete documentation index, see [llms.txt](https://docs.svrunit.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.svrunit.com/use-cases/post-deployment-tests.md).

# Post Deployment Tests

SVRUnit can also be used to **test** different files and requirements on your server **after a deployment**.

Just imagine that you need to test that your .env file exists, or that your cache folder has the correct permission.

There's plenty of things you can do here.

Because SVRUnit allows you to install it with Composer, it is recommended to install it directly as dependency. You can of course also use the PHAR file for this.

```bash
composer require svrunit/svrunit
```

Now create a **XML configuration** file that specifies a single YML test file (or more...)

```xml
<svrunit>  
  <testsuites>   
      
      <testsuite name="Post Deployment Tests">         
         <file>./post_deployment_tests.yml</file>      
      </testsuite>   
        
  </testsuites>
</svrunit>
```

Last but not least, we need the specification of our tests in the YAML file.

```yaml
file_exists:

  - name: ".env file is deployed"
    file: "/var/www/html/.env"
    expected: true
        
  ....
  ....
```

That's it!

You can now **manually** run your tests, or even use your **CI/CD pipeline** for this.

<pre class="language-bash"><code class="lang-bash"><strong>php vendor/bin/svrunit --configuration=deployment_tests.xml  
</strong></code></pre>

&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.svrunit.com/use-cases/post-deployment-tests.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
