lundi 30 avril 2018

Laravel testing (sitemap xml page) ->get() returns blank xml

I'm trying to test a Laravel sitemap page.

Want to test that a uri 'sitemap/departments.xml' contains '/adhesives-sealants/adhesives/c657'

Here is my code:

    $response = $this->get( 'sitemap/departments.xml');

    $response->assertSee('/adhesives-sealants/adhesives/c657');

This is the response I get from test:

   Failed asserting that '' contains "/interior-exterior-pva-wood-glue/p31670".

When I dump out $response I get this:

<?xml version="1.0" encoding="UTF-8"?>
  <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
        http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
  </urlset>

Which is not what is on the page!

Page looks like this:

xml

Where am i going wrong???

1 commentaire:

  1. Adhesives and sealants can be deformed according to the shape of the sealing surface, and it is not easy to flow and has a certain adhesiveness. It is made of dry or non-drying viscous materials such as asphalt, tar, rubber and resin, and is added with various compounding agents. Adhesives and Sealants testing

    RépondreSupprimer