The OOP & refactor project weekly report 4

Hello, in this week I have finished my works on templates of table related scripts. They are covered in PR 1700.

Files Covered In This Week

  • TableSearch.class.php
  • tbl_columns_definitions_form.lib.php
  • tbl_gis_visualization.lib.php
  • tbl_indexes.lib.php
  • tbl_relation.lib.php

Outcomes In This Week

Templates for table related scripts
Firstly, the tbl_indexes.lib.php and tbl_gis_visualization.lib.php is the two easiest for me. The most challenging script is the TableSearch.class.php, since HTML generation functions are usually reference to private helper functions and member variables by using $this. To solve this problem, I took out HTMLs from these helper functions and integrate them into where there were referenced before. Further, I kept contents from some of these function as common templates. By templating on table related scripts, it will be easier for me to move on in the next phase of work.

The Problem I am Facing

There are so many assertion on HTML tags in unit test. For example, the following code will fail the test below but it just work fine in our browser:

<form method="post"
action="tbl_create.php"
class="create_table _form ajax lockpage">

The unit test code:

$this->assertContains('<form method="post" action="tbl_create.php" '
. 'class="create_table _form ajax lockpage">', $result);

Maybe we could use a more effective way to test front-end components (templates, pages, etc) in the future, though I haven’t figure out how to achieve this goal yet.
Could you give me some suggestions about this?

What will I Do Next

Since I have two final examations in the next week, I will leave from work temporarily until June 5th. By the moment I will start working on creating preliminary classes of table related scripts.

Advertisements
The OOP & refactor project weekly report 4

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s