Know that divinity has many states [maqamat], which are, according to "Collectivity" [jam], explained in two: First: Divinity of Essence. Second: Divinity of Action. If by testifying that divinity is confined to Allah we mean the Divinity of Essence, its truth, with that of takbir, will come close to each other if ilah (divinity) is derived from "aliha fish-shay' ", i.e. 'He became perplexed about it', or derived from "laha", i.e. 'He became lofty' or derived from "laha yaluhu", i. e. 'He concealed himself. In this case its connection to the adhan and the Salat becomes known by referring to the chapter of takbir, and so does its discipline. But to repeat it again, though not void of some advantage, is contrary to brevity. If we take aliha to mean: "He worshipped", and ma'Iuh to mean: "the worshipped", then the salik must make the formal testimony of the confinement of diety to Allah, the Most High, comply with the inner cordial testimony, and he should know that should there be in the heart a diety other than Allah, he would be a hypocrite in his testimony.
So, the salik is to convey to his heart, by whatever austerity, his testimony about divinity, and to smash in his heart the big and small idols which have been engraved by the intruding hands of Satan and the evil-commanding soul, and to sweep them away, so that he may become fit to be in the Presence of His Sacred Essence. As long as the idols of loving the world and mundane affairs are still in the ka'bah of the heart, the salik will find no way to his goal. So, testifying to divinity is to announce to the worldly and heavenly powers that the false dieties and the crooked objectives should be trod upon so as to be able to ascend to Allah's Proximity.
But if the confinement of divinity is intended for Divinity of Action, which is management and effectiveness, the meaning of the testimony will be: I testify that there is no manager and no effective influence in the world of achievement, and in the visible and the invisible save the Sacred Essence of Allah, the Most High. If the salik's heart cherished dependence on any being among the beings, and trusted any individual among the individuals, his heart would be diseased and his testimony false.
Thus, the salik must first strengthen, with judicial proof, the fact that "There is no effecter [mu'aththir] in the (world of) existence except Allah". He must not evade the divine knowledge, which is the objective of sending prophets, and not turn away from remembering Allah and from the affairs of the Essence and Attributes, for the source of all (kinds of) happiness is the remembrance of Allah: "And whoever turns away from remembering Me, his shall surely be a straitened life".  After attaining to the truth of this divine delicacy, which is the source of the divine knowledge and the door of the doors of the hidden facts, by way of thinking and reasoning, he is to make his heart, through remembrance and austerity, familiar with them until it believes in them. This would be the first stage of the truthfulness of his words, and it is marked by complete dependence on Allah, and by taking the eye of greed and hope away from all beings, a fact which results in believing in Allah's Unity of Action, being one of the great states of the people of knowledge. Having ascribed all effects to Allah, and closed the eye of greed against all beings, save His Sacred Essence, the salik becomes worthy attending the Sacred Presence, or rather his heart becomes, by nature, attentive to that Presence. Repeating the testimony may be for confirming it, and by the testimony we mean one of the two testimonies, or it may not be a repetition, but one may refer to the Divinity of Essence and the other to the Divinity of Action. In this instance, its repetition at the end may be to confirm them, and that is why it is not mentioned these with the very words: "I testify."
A Gnostic Note
Know that testimony is of many stages, of which we shall be satisfied with referring to a few, as suits these pages.
The first is the Verbal Testimony [shahadat-i qauliyah], which is already known. If the verbal testimony is not accompanied with cordial testimony, even in a lower stage, it will not be a testimony, but a deception and a hypocrisy, as it was mentioned in the hadith concerning takbir, quoted from Imam as Sadiq (AS). 
The second is the Practical Testimony [shahadat-i fi'liyah], which means that man testifies through the practices of his organs. For example, he is, in the type and method of his action, to apply the fact that: "There is no effecter [mu 'aththir] in the (world of) existence save Allah", and, as his verbal testimony requires him to think that nobody is effective, he should work out the plan of his acts accordingly. Hence, he should not extend the hand of need to anybody except to the Sacred Presence of Allah, the Most High, nor should he open the eye of expectation at any being. He should show himself rich and in no need, before the weak servants, and keep aloof from weakness, humility and inability.
This is frequently referred to by noble hadiths, as is in a narrative stated in the noble al-Kafi: "A believer's dignity is to manage without the help of the people."  Showing oneself well off and prosperous is one of the religious commendable practices, while demanding things from people is undesirable. In short, one must put to practice the divine grace: "There is no effecter in the (world of) existence except Allah" in his external kingdom.
The third is the Cordial Testimony [shahadat-i qalbiyah], which is the source of the practical and verbal testimonies, as without it, these would not come to actuality. And it is that Allah's Unity of Action manifests in the heart, which realizes, by way of its inner secret, the truth of this grace, and separates itself from other beings. Most of the narratives quoted from the infallible Ahlul Bayt (AS) concerning abandoning looking with greed at what is in the hands of the people, and despairing of the servants, and trusting and confiding in Allah, the Exalted and Most High, refer to this situation.
It is in al-Kafi, on the authority of 'Ali ibn al-Husayn (AS) that he said: "I found that the entire goodness is gathered in cutting one's coveting what is in the hands of others, and whoever placed no hope on the people in anything, and entrusted himself to Allah, the Exalted, in all his affairs, Allah would respond to him in all the things."  Hadiths of this kind are many.
The fourth is the Essence Testimony (Personal Testimony = shahadat-i dhatiyah), i.e. the existential testimony, and it appears in the perfect holy men. To the holy men, this testimony is present in all beings, in one way or another. Perhaps the ayah :"Allah bears witness that there is no god but He, and (so do) the angels and the possessors of knowledge",  is a hint at the Essence Testimony, for Allah, the Exalted, in the state of " the Collective Oneness " [ahadiyat-I dhatiyah] gives Personal testimony to His own Unity [wahdaniyat] , because mere existence by itself denotes the Essence-Oneness [ahadiyat-I dhatiyah], and in the rising of the Day of Resurrection it appears in Complete Unity [wahdaniyat-I tammah]. This Oneness [ahadiyat] appears first in the mirror of the Collectivity [jam], then in the mirror of distinctness [tafsil]. For this reason He said :" ...and the angels and the possessors of knowledge". In this instance there are many states of knowledge [ma'arif] that are out of the obligation of these pages to explain.
In the exegesis of Muhammad ibn Mas'ud al-'Ayyashi, quoting 'Abdus Samad ibn Bashir, it is said: "The beginning of the adhan was mentioned to Abu 'Abdullah (Imam as-Sadiq) (AS), and he said: 'The Messenger of Allah (SA) was (once) sleeping in the shadow of the ka'bah, when Gabriel came to him with a bowl of water from Paradise. He woke him up and told him to wash himself with it. Then he (the Prophet) was put in a carriage with a thousand colors of light, and he was taken high up to the doors of the heaven. When the angels saw him, they ran away from the doors of the heaven, exclaiming: 'Two gods, a god in the earth and a god in the heaven!' Allah commanded Gabriel to shout: Allahu akbar! Allahu akbar!' So the angels returned to the doors of the heaven. The door was opened, and he proceeded until he reached the second heaven. The angels ran away from the doors of the heaven. There he said: 'I testify that there is no god but Allah! I testify that there is no god but Allah!' The angels returned, as they realized that he was a creature. Then the door was opened and he went in ..." as the hadith goes on. 
A similar concept is stated in a narrative in 'Ilalush-Shara 'i'.  These hadiths denote that testifying to Allah's Divinity opens the doors of the heaven and penetrates the barriers, and causes the angels of Allah to gather. The veil which is penetrated through by testifying to His Divinity and by confessing it to be exclusively His, is of the thick veils of darkness, and, as long as the salik is wrapped in it, he will have no way to attend the Presence, and unless this door opens to him, he will not be admitted. That barrier is the veil of the multiplicity of acts, and to fall in this multiplicating veil results in taking the created beings to be effective and influential, which means regarding them to be independent in their action, which is admitting, the impossible and is a great polytheism, while, on the other hand, the result of testifying to the divinity to be exclusively Allah's, is testifying to the Unity of Action and annihilating the multiplicities in Allah's Act, and denying anyone else to have any effect or effectiveness, and believing that independence belongs to Allah, the Exalted. It was by means of this testimony that the angels of the heaven came out of the veil of the multiplicity of "A god in the earth and a god in the heaven", and returned from fleeing away and dispersing to familiarity and gathering, and then the doors of the heaven opened to them. So, the salik must also penetrate through this veil of his darkness by way of this testimony and open the doors of heaven to himself, and step out of the heavy veil of the independence, so that the way of ascension to the mi'raj of His Proximity becomes closer. But this cannot be brought about by mere verbal utterances of remembering Allah, as that is why our acts of worship do not cross the limit of the mundane formality, and, thus, no door will be opened to us and no veil will be pushed off our faces.
. Surah Ta-Ha: 124.
. Refer to footnote No. 190.
. Usulul Kafi, vol. 3, p. 218, "Book of Faith and Disbelief', ch. on "Doing Without the People" hadith 1.
. Ibid., hadith 3.
. Surah Al-i 'Imran: 18
. Al-'Ayyashi's Exegesis (on the Qur'an), vol. 1, p. 157, Commenting on Surah al-Baqarah, narrative 530.
. Ilalush Shara'i, vol. 2, p. 312.