Minor - Fix travis behat test (delete lp category)

pull/3173/head
Julio Montoya 7 years ago
parent a7b7ec466a
commit 18427072b8
  1. 4
      main/lp/learnpath.class.php
  2. 6
      main/lp/lp_controller.php
  3. 2
      main/template/default/learnpath/list.tpl
  4. 15
      tests/behat/features/toolLp.feature

@ -12653,7 +12653,11 @@ EOD;
$sql = "DELETE FROM $tbl_tool
WHERE c_id = ".$courseId." AND (link LIKE '$link%' AND image='lp_category.gif')";
Database::query($sql);
return true;
}
return false;
}
/**

@ -660,8 +660,10 @@ switch ($action) {
api_not_allowed(true);
}
if (isset($_REQUEST['id'])) {
learnpath::deleteCategory($_REQUEST['id']);
Display::addFlash(Display::return_message(get_lang('Deleted')));
$result = learnpath::deleteCategory($_REQUEST['id']);
if ($result) {
Display::addFlash(Display::return_message(get_lang('Deleted')));
}
}
require 'lp_list.php';
break;

@ -22,7 +22,7 @@
{% if categories|length > 1 and lp_data.category.id %}
{% if is_allowed_to_edit %}
<h3 class="page-header">
{{ lp_data.category.getName() }}
{{ lp_data.category.getName() | trim }}
{% if lp_data.category.getId() > 0 %}
{% if not _c.session_id %}

@ -49,13 +49,6 @@ Feature: LP tool
And I should see "Document 1"
And I should see "Exercise 1"
Scenario: Delete a LP category
Given I am on "/main/lp/lp_controller.php?cidReq=TEMP&action=list&isStudentView=false"
And wait for the page to be loaded
Then I should see "LP category 1"
And I follow "Delete"
Then I should not see "LP category 1"
# Scenario: Check the PDF export in LP list if hide SCORM PDF link is false
# Given I am on "/main/admin/settings.php?category=Course"
# And I check the "hide_scorm_pdf_link" radio button with "false" value
@ -72,6 +65,14 @@ Feature: LP tool
Scenario: Delete a LP
Given I am on "/main/lp/lp_controller.php?cidReq=TEMP&action=list"
And wait for the page to be loaded
And I follow "Delete"
And I confirm the popup
Then I should not see "LP 1"
Scenario: Delete a LP category
Given I am on "/main/lp/lp_controller.php?cidReq=TEMP&action=list&isStudentView=false"
And wait for the page to be loaded
Then I should see "LP category 1"
And I follow "Delete"
Then I should see "Deleted"
Loading…
Cancel
Save