There is no license information available for the latest version (0.3.5) of this package.

Parse and validate sitemap.xml files

0.3.5 2017-10-11 05:51 UTC

This package is auto-updated.

Last update: 2024-05-20 01:38:31 UTC


Build Status Code Climate Test Coverage Issue Count Latest Stable Version Total Downloads

This package provides parsing and validation of sitemap.xml files


You need to add the repository into your composer.json file

    composer require --dev portrino/codeception-sitemap-module


You can use this module as any other Codeception module, by adding 'Sitemap' to the enabled modules in your Codeception suite configurations.

Enable module and setup the configuration variables

The url could be set in config file directly or via an environment variable: %BASE_URL%

        - Sitemap:
            depends: PhpBrowser
            url: ADD_YOUR_BASE_URL_HERE

You could also configure the guzzle instance of the sitemap parser package. For example to disable SSL certification checks:

      - Sitemap:
              verify: false

Update Codeception build

  codecept build

Implement the cept / cest

    $I->wantToTest('If sitemap is valid.');
    // validation against https://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd
    // sitemap will be retrieved from: http://<www.domain.tld>/sitemap.xml, where http://<www.domain.tld>/ is configured in module config
    // validation against https://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd
    // siteindex will be retrieved from: http://<www.domain.tld>/sitemap_index.xml, where http://<www.domain.tld>/ is configured in module config

    // validate url occurence (also recursively through siteindex files!)
    // complete url
    $I->seeSiteMapContainsUrl('sitemap_index.xml', 'https://www.domain.tld/foo/bar/');
    // without base_url (checks if one of the sitemap urls contains the path) 
    $I->seeSiteMapContainsUrlPath('sitemap.xml', '/foo/bar');
    // via response object


  • André Wuttig - Initial work, Unit Tests, Documentation - aWuttig

See also the list of contributors who participated in this project.