Merge branch '2.9-release'

This commit is contained in:
John Bintz 2010-01-23 10:03:15 -05:00
commit 6181a4ee3c
4 changed files with 74 additions and 7 deletions

3
test/fixtures/destroy-widgets.inc vendored Normal file
View File

@ -0,0 +1,3 @@
<?php
$builder->option('sidebars_widgets', array());

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="" />
<title>TestWidgetInitIsCorrect</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">TestWidgetInitIsCorrect</td></tr>
</thead><tbody>
<tr>
<td>open</td>
<td>/wp-admin/</td>
<td></td>
</tr>
<!--Blow away all widgets-->
<tr>
<td>clickAndWait</td>
<td>link=Post Fixtures</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=themes/comicpress-2.8/test/fixtures/destroy-widgets.inc</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>pf[is_ok]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//input[@value='Load Provided Data']</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>New data set loaded into WordPress.</td>
<td></td>
</tr>
<!--Check to make sure no widgets have lingering init code-->
<tr>
<td>clickAndWait</td>
<td>site-visit-button</td>
<td></td>
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>//script[contains(text(), 'var image_root')]</td>
<td></td>
</tr>
<!--Done, go home-->
<tr>
<td>open</td>
<td>/wp-admin/</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>

View File

@ -45,11 +45,10 @@ class ComicPressBookmarkWidget extends WP_Widget {
); );
} }
function init() { function init() {}
add_action('wp_head', array(&$this, 'wp_head'));
}
function is_active() { function is_active() {
add_action('wp_head', array(&$this, 'wp_head'));
add_action('template_redirect', array(&$this, 'template_redirect')); add_action('template_redirect', array(&$this, 'template_redirect'));
} }