From 562979c4a8fe47952edf7986d4144624e41630f7 Mon Sep 17 00:00:00 2001 From: wei <> Date: Mon, 4 Dec 2006 02:42:57 +0000 Subject: add unit tests for active record and sqlmap --- tests/simple_unit/SqlMap/domain/A.php | 27 ++++++++ tests/simple_unit/SqlMap/domain/Account.php | 36 +++++++++++ tests/simple_unit/SqlMap/domain/AccountBis.php | 13 ++++ .../SqlMap/domain/AccountCollection.php | 17 ++++++ tests/simple_unit/SqlMap/domain/B.php | 23 +++++++ tests/simple_unit/SqlMap/domain/Book.php | 11 ++++ tests/simple_unit/SqlMap/domain/C.php | 15 +++++ tests/simple_unit/SqlMap/domain/Category.php | 19 ++++++ tests/simple_unit/SqlMap/domain/Complex.php | 11 ++++ tests/simple_unit/SqlMap/domain/D.php | 16 +++++ tests/simple_unit/SqlMap/domain/Document.php | 16 +++++ .../SqlMap/domain/DocumentCollection.php | 8 +++ tests/simple_unit/SqlMap/domain/E.php | 16 +++++ tests/simple_unit/SqlMap/domain/F.php | 16 +++++ tests/simple_unit/SqlMap/domain/LineItem.php | 32 ++++++++++ .../SqlMap/domain/LineItemCollection.php | 8 +++ tests/simple_unit/SqlMap/domain/Newspaper.php | 12 ++++ tests/simple_unit/SqlMap/domain/Order.php | 71 ++++++++++++++++++++++ tests/simple_unit/SqlMap/domain/Other.php | 23 +++++++ tests/simple_unit/SqlMap/domain/Sample.php | 55 +++++++++++++++++ tests/simple_unit/SqlMap/domain/Search.php | 23 +++++++ tests/simple_unit/SqlMap/domain/User.php | 27 ++++++++ 22 files changed, 495 insertions(+) create mode 100644 tests/simple_unit/SqlMap/domain/A.php create mode 100644 tests/simple_unit/SqlMap/domain/Account.php create mode 100644 tests/simple_unit/SqlMap/domain/AccountBis.php create mode 100644 tests/simple_unit/SqlMap/domain/AccountCollection.php create mode 100644 tests/simple_unit/SqlMap/domain/B.php create mode 100644 tests/simple_unit/SqlMap/domain/Book.php create mode 100644 tests/simple_unit/SqlMap/domain/C.php create mode 100644 tests/simple_unit/SqlMap/domain/Category.php create mode 100644 tests/simple_unit/SqlMap/domain/Complex.php create mode 100644 tests/simple_unit/SqlMap/domain/D.php create mode 100644 tests/simple_unit/SqlMap/domain/Document.php create mode 100644 tests/simple_unit/SqlMap/domain/DocumentCollection.php create mode 100644 tests/simple_unit/SqlMap/domain/E.php create mode 100644 tests/simple_unit/SqlMap/domain/F.php create mode 100644 tests/simple_unit/SqlMap/domain/LineItem.php create mode 100644 tests/simple_unit/SqlMap/domain/LineItemCollection.php create mode 100644 tests/simple_unit/SqlMap/domain/Newspaper.php create mode 100644 tests/simple_unit/SqlMap/domain/Order.php create mode 100644 tests/simple_unit/SqlMap/domain/Other.php create mode 100644 tests/simple_unit/SqlMap/domain/Sample.php create mode 100644 tests/simple_unit/SqlMap/domain/Search.php create mode 100644 tests/simple_unit/SqlMap/domain/User.php (limited to 'tests/simple_unit/SqlMap/domain') diff --git a/tests/simple_unit/SqlMap/domain/A.php b/tests/simple_unit/SqlMap/domain/A.php new file mode 100644 index 00000000..6830ea4d --- /dev/null +++ b/tests/simple_unit/SqlMap/domain/A.php @@ -0,0 +1,27 @@ +_ID; } + public function setID($value){ $this->_ID = $value; } + + public function getLibelle(){ return $this->_Libelle; } + public function setLibelle($value){ $this->_Libelle = $value; } + + public function getB(){ return $this->_B; } + public function setB($value){ $this->_B = $value; } + + public function getE(){ return $this->_E; } + public function setE($value){ $this->_E = $value; } + + public function getF(){ return $this->_F; } + public function setF($value){ $this->_F = $value; } +} + +?> \ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/Account.php b/tests/simple_unit/SqlMap/domain/Account.php new file mode 100644 index 00000000..f01726ba --- /dev/null +++ b/tests/simple_unit/SqlMap/domain/Account.php @@ -0,0 +1,36 @@ +_ID; } + public function setID($value){ $this->_ID = intval($value); } + + public function getFirstName(){ return $this->_FirstName; } + public function setFirstName($value){ $this->_FirstName = $value; } + + public function getLastName(){ return $this->_LastName; } + public function setLastName($value){ $this->_LastName = $value; } + + public function getEmailAddress(){ return $this->_EmailAddress; } + public function setEmailAddress($value){ $this->_EmailAddress = $value; } + + public function getIDS(){ return $this->_IDS; } + public function setIDS($value){ $this->_IDS = $value; } + + public function getBannerOptions(){ return $this->_BannerOptions; } + public function setBannerOptions($value){ $this->_BannerOptions = $value; } + + public function getCartOptions(){ return $this->_CartOptions; } + public function setCartOptions($value){ $this->_CartOptions = $value; } + +} + +?> \ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/AccountBis.php b/tests/simple_unit/SqlMap/domain/AccountBis.php new file mode 100644 index 00000000..8c96d8e4 --- /dev/null +++ b/tests/simple_unit/SqlMap/domain/AccountBis.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/AccountCollection.php b/tests/simple_unit/SqlMap/domain/AccountCollection.php new file mode 100644 index 00000000..9fc8edb7 --- /dev/null +++ b/tests/simple_unit/SqlMap/domain/AccountCollection.php @@ -0,0 +1,17 @@ +add($account); + } + + public function copyTo(TList $array) + { + $array->copyFrom($this); + } +} + +?> \ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/B.php b/tests/simple_unit/SqlMap/domain/B.php new file mode 100644 index 00000000..a05e21d4 --- /dev/null +++ b/tests/simple_unit/SqlMap/domain/B.php @@ -0,0 +1,23 @@ +_C; } + public function setC($value){ $this->_C = $value; } + + public function getD(){ return $this->_D; } + public function setD($value){ $this->_D = $value; } + + public function getID(){ return $this->_ID; } + public function setID($value){ $this->_ID = $value; } + + public function getLibelle(){ return $this->_Libelle; } + public function setLibelle($value){ $this->_Libelle = $value; } +} + +?> \ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/Book.php b/tests/simple_unit/SqlMap/domain/Book.php new file mode 100644 index 00000000..cc12c30e --- /dev/null +++ b/tests/simple_unit/SqlMap/domain/Book.php @@ -0,0 +1,11 @@ +_PageNumber; } + public function setPageNumber($value){ $this->_PageNumber = $value; } +} + +?> \ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/C.php b/tests/simple_unit/SqlMap/domain/C.php new file mode 100644 index 00000000..09fb456a --- /dev/null +++ b/tests/simple_unit/SqlMap/domain/C.php @@ -0,0 +1,15 @@ +_ID; } + public function setID($value){ $this->_ID = $value; } + + public function getLibelle(){ return $this->_Libelle; } + public function setLibelle($value){ $this->_Libelle = $value; } +} + +?> \ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/Category.php b/tests/simple_unit/SqlMap/domain/Category.php new file mode 100644 index 00000000..83fecc7e --- /dev/null +++ b/tests/simple_unit/SqlMap/domain/Category.php @@ -0,0 +1,19 @@ +_ID; } + public function setID($value){ $this->_ID = $value; } + + public function getName(){ return $this->_Name; } + public function setName($value){ $this->_Name = $value; } + + public function getGuidString(){ return $this->_Guid; } + public function setGuidString($value){ $this->_Guid = $value; } +} + +?> \ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/Complex.php b/tests/simple_unit/SqlMap/domain/Complex.php new file mode 100644 index 00000000..92b500f4 --- /dev/null +++ b/tests/simple_unit/SqlMap/domain/Complex.php @@ -0,0 +1,11 @@ +_map; } + public function setMap(TMap $map){ $this->_map = $map; } +} + +?> \ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/D.php b/tests/simple_unit/SqlMap/domain/D.php new file mode 100644 index 00000000..5d1baabd --- /dev/null +++ b/tests/simple_unit/SqlMap/domain/D.php @@ -0,0 +1,16 @@ +_ID; } + public function setID($value){ $this->_ID = $value; } + + public function getLibelle(){ return $this->_Libelle; } + public function setLibelle($value){ $this->_Libelle = $value; } + +} + +?> \ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/Document.php b/tests/simple_unit/SqlMap/domain/Document.php new file mode 100644 index 00000000..63bcfd33 --- /dev/null +++ b/tests/simple_unit/SqlMap/domain/Document.php @@ -0,0 +1,16 @@ +_ID; } + public function setID($value){ $this->_ID = $value; } + + public function getTitle(){ return $this->_Title; } + public function setTitle($value){ $this->_Title = $value; } + +} + +?> \ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/DocumentCollection.php b/tests/simple_unit/SqlMap/domain/DocumentCollection.php new file mode 100644 index 00000000..c15b6f7d --- /dev/null +++ b/tests/simple_unit/SqlMap/domain/DocumentCollection.php @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/E.php b/tests/simple_unit/SqlMap/domain/E.php new file mode 100644 index 00000000..2c80bb46 --- /dev/null +++ b/tests/simple_unit/SqlMap/domain/E.php @@ -0,0 +1,16 @@ +_ID; } + public function setID($value){ $this->_ID = $value; } + + public function getLibelle(){ return $this->_Libelle; } + public function setLibelle($value){ $this->_Libelle = $value; } + +} + +?> \ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/F.php b/tests/simple_unit/SqlMap/domain/F.php new file mode 100644 index 00000000..b1090cc6 --- /dev/null +++ b/tests/simple_unit/SqlMap/domain/F.php @@ -0,0 +1,16 @@ +_ID; } + public function setID($value){ $this->_ID = $value; } + + public function getLibelle(){ return $this->_Libelle; } + public function setLibelle($value){ $this->_Libelle = $value; } + +} + +?> \ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/LineItem.php b/tests/simple_unit/SqlMap/domain/LineItem.php new file mode 100644 index 00000000..d851da6c --- /dev/null +++ b/tests/simple_unit/SqlMap/domain/LineItem.php @@ -0,0 +1,32 @@ +_ID; } + public function setID($value){ $this->_ID = $value; } + + public function getOrder(){ return $this->_Order; } + public function setOrder($value){ $this->_Order = $value; } + + public function getCode(){ return $this->_Code; } + public function setCode($value){ $this->_Code = $value; } + + public function getQuantity(){ return $this->_Quantity; } + public function setQuantity($value){ $this->_Quantity = $value; } + + public function getPrice(){ return $this->_Price; } + public function setPrice($value){ $this->_Price = $value; } + + public function getPictureData(){ return $this->_PictureData; } + public function setPictureData($value){ $this->_PictureData = $value; } + +} + +?> \ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/LineItemCollection.php b/tests/simple_unit/SqlMap/domain/LineItemCollection.php new file mode 100644 index 00000000..f177487c --- /dev/null +++ b/tests/simple_unit/SqlMap/domain/LineItemCollection.php @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/Newspaper.php b/tests/simple_unit/SqlMap/domain/Newspaper.php new file mode 100644 index 00000000..4eb56aa2 --- /dev/null +++ b/tests/simple_unit/SqlMap/domain/Newspaper.php @@ -0,0 +1,12 @@ +_City; } + public function setCity($value){ $this->_City = $value; } + +} + +?> \ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/Order.php b/tests/simple_unit/SqlMap/domain/Order.php new file mode 100644 index 00000000..65d18b13 --- /dev/null +++ b/tests/simple_unit/SqlMap/domain/Order.php @@ -0,0 +1,71 @@ +_LineItemsList = new TList; + $this->_LineItems = new TList; + $this->_FavouriteLineItem = new LineItem; + } + + public function getID(){ return $this->_ID; } + public function setID($value){ $this->_ID = $value; } + + public function getAccount(){ return $this->_Account; } + public function setAccount($value){ $this->_Account = $value; } + + public function getDate(){ return $this->_Date; } + public function setDate($value){ $this->_Date = $value; } + + public function getCardType(){ return $this->_CardType; } + public function setCardType($value){ $this->_CardType = $value; } + + public function getCardExpiry(){ return $this->_CardExpiry; } + public function setCardExpiry($value){ $this->_CardExpiry = $value; } + + public function getCardNumber(){ return $this->_CardNumber; } + public function setCardNumber($value){ $this->_CardNumber = $value; } + + public function getStreet(){ return $this->_Street; } + public function setStreet($value){ $this->_Street = $value; } + + public function getCity(){ return $this->_City; } + public function setCity($value){ $this->_City = $value; } + + public function getProvince(){ return $this->_Province; } + public function setProvince($value){ $this->_Province = $value; } + + public function getPostalCode(){ return $this->_PostalCode; } + public function setPostalCode($value){ $this->_PostalCode = $value; } + + public function getLineItemsList(){ return $this->_LineItemsList; } + public function setLineItemsList($value){ $this->_LineItemsList = $value; } + + public function getLineItems(){ return $this->_LineItems; } + public function setLineItems($value){ $this->_LineItems = $value; } + + public function getLineItemsArray(){ return $this->_LineItemsArray; } + public function setLineItemsArray($value){ $this->_LineItemsArray = $value; } + + public function getFavouriteLineItem(){ return $this->_FavouriteLineItem; } + public function setFavouriteLineItem($value){ $this->_FavouriteLineItem = $value; } + +} + +?> \ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/Other.php b/tests/simple_unit/SqlMap/domain/Other.php new file mode 100644 index 00000000..32d85e90 --- /dev/null +++ b/tests/simple_unit/SqlMap/domain/Other.php @@ -0,0 +1,23 @@ +_Bool2; } + public function setBool2($value){ $this->_Bool2 = $value; } + + public function getBool(){ return $this->_Bool; } + public function setBool($value){ $this->_Bool = $value; } + + public function getInt(){ return $this->_Int; } + public function setInt($value){ $this->_Int = $value; } + + public function getLong(){ return $this->_Long; } + public function setLong($value){ $this->_Long = $value; } +} + +?> \ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/Sample.php b/tests/simple_unit/SqlMap/domain/Sample.php new file mode 100644 index 00000000..c9a34601 --- /dev/null +++ b/tests/simple_unit/SqlMap/domain/Sample.php @@ -0,0 +1,55 @@ +_FirstID; } + public function setFirstID($value){ $this->_FirstID = $value; } + + public function getSecondID(){ return $this->_SecondID; } + public function setSecondID($value){ $this->_SecondID = $value; } + + public function getThirdID(){ return $this->_ThirdID; } + public function setThirdID($value){ $this->_ThirdID = $value; } + + public function getFourthID(){ return $this->_FourthID; } + public function setFourthID($value){ $this->_FourthID = $value; } + + public function getFifthID(){ return $this->_FifthID; } + public function setFifthID($value){ $this->_FifthID = $value; } + + public function getSequenceID(){ return $this->_SequenceID; } + public function setSequenceID($value){ $this->_SequenceID = $value; } + + public function getDistributedID(){ return $this->_DistributedID; } + public function setDistributedID($value){ $this->_DistributedID = $value; } + + public function getSampleChar(){ return $this->_SampleChar; } + public function setSampleChar($value){ $this->_SampleChar = $value; } + + public function getSampleDecimal(){ return $this->_SampleDecimal; } + public function setSampleDecimal($value){ $this->_SampleDecimal = $value; } + + public function getSampleMoney(){ return $this->_SampleMoney; } + public function setSampleMoney($value){ $this->_SampleMoney = $value; } + + public function getSampleDate(){ return $this->_SampleDate; } + public function setSampleDate($value){ $this->_SampleDate = $value; } + + public function getSequenceDate(){ return $this->_SequenceDate; } + public function setSequenceDate($value){ $this->_SequenceDate = $value; } +} + +?> \ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/Search.php b/tests/simple_unit/SqlMap/domain/Search.php new file mode 100644 index 00000000..a09ca6e6 --- /dev/null +++ b/tests/simple_unit/SqlMap/domain/Search.php @@ -0,0 +1,23 @@ +_NumberSearch; } + public function setNumberSearch($value){ $this->_NumberSearch = $value; } + + public function getStartDate(){ return $this->_StartDate; } + public function setStartDate($value){ $this->_StartDate = $value; } + + public function getOperande(){ return $this->_Operande; } + public function setOperande($value){ $this->_Operande = $value; } + + public function getStartDateAnd(){ return $this->_StartDateAnd; } + public function setStartDateAnd($value){ $this->_StartDateAnd = $value; } +} + +?> \ No newline at end of file diff --git a/tests/simple_unit/SqlMap/domain/User.php b/tests/simple_unit/SqlMap/domain/User.php new file mode 100644 index 00000000..0c3a547f --- /dev/null +++ b/tests/simple_unit/SqlMap/domain/User.php @@ -0,0 +1,27 @@ +_ID; } + public function setID($value){ $this->_ID = $value; } + + public function getUserName(){ return $this->_UserName; } + public function setUserName($value){ $this->_UserName = $value; } + + public function getPassword(){ return $this->_Password; } + public function setPassword($value){ $this->_Password = $value; } + + public function getEmailAddress(){ return $this->_EmailAddress; } + public function setEmailAddress($value){ $this->_EmailAddress = $value; } + + public function getLastLogon(){ return $this->_LastLogon; } + public function setLastLogon($value){ $this->_LastLogon = $value; } +} + +?> \ No newline at end of file -- cgit v1.2.3